Language independent way to get "My Documents" folder in VBA Excel 2003 Language independent way to get "My Documents" folder in VBA Excel 2003 vba vba

Language independent way to get "My Documents" folder in VBA Excel 2003


This may suit:

Set WshShell = CreateObject("WScript.Shell")strDocuments = WshShell.SpecialFolders("MyDocuments")

From: http://msdn.microsoft.com/en-us/library/0ea7b5xe.aspx

Although the special folder name is MyDocuments, it refers to the documents folder for several versions of Windows.


You may use "Documents", as the localized versions point to the same location.

' Application.PathSeparator can be used, but this' is unlikely to work on non-Windows environmentsMyDocsPath = Environ$("USERPROFILE") & "\Documents\"

(Seeing that this is a 10 years old question it may not have been the case back then. :)