I needed to add current working directory to a macro which I thought would be simple using an environment variable, but quickly learned Extra basic does not recognize "CD" like windows does. After searching I found the code below to see what all variables I have at my disposal and to my dismay none provide current working directory. Can someone suggest an efficient method of finding the path the Macro is currently running in?
Dim strEnviron As String
Dim i As Long
For i = 1 To 255
strEnviron = Environ(i)
If LenB(strEnviron) = 0& Then Exit For
msgbox strEnviron
Next