View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Saving to "MyDocuments" on users computer

You can find the "my documents" path with something like:

Option Explicit
Sub testme()
Dim myDocumentsPath As String

Dim wsh As Object

Set wsh = CreateObject("WScript.Shell")
myDocumentsPath = wsh.SpecialFolders.Item("mydocuments")

MsgBox myDocumentsPath

End Sub


Duane Reynolds 323310 wrote:

I am writing a macro i want to be able to save a file to the users "My
Document/expired contracts". Not all users have the same path to My
Documents. Does VBA recognize %user% type commands? What would be the proper
syntax to make this work.
Thanks
Duane Reynolds


--

Dave Peterson