Opening a specifice spreadsheet from Access?

Talismanic

Registered User.
Local time
Today, 14:48
Joined
May 25, 2000
Messages
377
I found several posts that showed how to open a specific spreadsheet with the shell command but I could not get it to work. What am I doing wrong?

Dim strFilePath As String
strFilePath = "I:\Workers's_Temp\ImportSpec.xls"

' I tried it like this also:
' strFilePath = "I:\Workers's Temp\ImportSpec.xls"
' Withoout the underscore in the path name.

Shell "c:\Program Files\Microsoft Office\Office\Excel.exe " & strFilePath, 1

Is says that it can not find the file and I am guessing that it has something to do with the space between Worker's and Temp. I can not rename that directory so how should I write the path from code?
 
What I tend to do is use the FollowHyperlink method instead. Again you can assign a value to a string and the method will use the string for directions.

e.g.

FollowHyperlink "I:\Workers's_Temp\ImportSpec.xls"

or

FollowHyperlink strFileName
 

Users who are viewing this thread

Back
Top Bottom