I wanted to set a new Environment Variables Name "Sample" and Value "E:\Sample" onto user variables not on system variables.
How do I do this using VBA excel?
Thank you and kind regards,
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