Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想为用户变量而不是系统变量设置一个新的环境变量名称“Sample”和值“E:\Sample”。
如何使用 VBA excel 执行此操作?
谢谢你和亲切的问候,
Sub addEnvironVariables() Dim WSS: Set WSS = CreateObject("WScript.Shell") Set System = WSS.Environment("User") System.Item("Sample") = System.Item("Sample") & ";C:\Sample" End Sub
Found it on youtube