Thread: File Path
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder Rob van Gelder is offline
external usenet poster
 
Posts: 37
Default File Path

Hi.

Sub test()
Dim strPath As String

strPath = CreateObject("WScript.Shell").SpecialFolders("MyDo cuments")
Debug.Print strPath
End Sub

Cheers,
Rob


Max2073 wrote:
Help needed.

I had developed a macro that was only used by myself, however this macro
will now also be used by others.

In the macro I was using the full file path, however this is now causing
some problems.

Is there anyway that I can change the macro to open the required files based
on the following path: -

c:\documents and settings\"username - logged on officer"\help.xls

The files that need to be opened are automatically named when exported from
the corporate database - the files will be named the same for each officer -
the only difference is the username.