Desktop path

  • Thread starter Thread starter Edson
  • Start date Start date
VBA?

If yes, then one way:

Option Explicit
Sub testme()
Dim myDesktopPath As String
myDesktopPath = CreateObject("WScript.Shell").SpecialFolders("Desktop")
MsgBox myDesktopPath
End Sub
 
tkx, Dave.

Dave Peterson said:
VBA?

If yes, then one way:

Option Explicit
Sub testme()
Dim myDesktopPath As String
myDesktopPath = CreateObject("WScript.Shell").SpecialFolders("Desktop")
MsgBox myDesktopPath
End Sub
 
Dave Peterson said:
If yes, then one way: ....
Sub testme()
Dim myDesktopPath As String
myDesktopPath = CreateObject("WScript.Shell").SpecialFolders("Desktop")
MsgBox myDesktopPath
End Sub
....

If users haven't gotten too creative, it's usually

Environ("USERPROFILE") & "\Desktop"
 
Back
Top