willwill88
New Member
- Joined
- Dec 8, 2011
- Messages
- 5
I'm trying to call a .bat file which is located in My Documents. Is there a way of making VBA in Excel to understand %userprofile%, so that it can be launched from different windows accounts?
Example:
Call Shell("C:\Documents and Settings\william\My Documents\AutoFormat.bat", vbReadOnly)
Call Shell("C:\Documents and Settings\%userprofile%\My Documents\AutoFormat.bat", vbReadOnly)
Cheers!
Example:
Call Shell("C:\Documents and Settings\william\My Documents\AutoFormat.bat", vbReadOnly)
Call Shell("C:\Documents and Settings\%userprofile%\My Documents\AutoFormat.bat", vbReadOnly)
Cheers!