I'm trying to open a file from VBA using a variable path and am not
having very much luck. Can anyone help?
This works:
retval = Shell("""Excel. EXE"" ""C:\Progra m files\MyPath\My File.xls""",
1)
This does not like the space in 'Program Files':
retval = Shell("Excel.EX E " & Application.Cur rentProject.Pat h &
"\MyFile.xl s", 1)
I've tried quotation marks all over the place in all sorts of
combinations and cannot get it to work. With the above example I get
the following message:
'C:\Program.xls ' could not be found...
That one is immediately followed by:
'Files\MyPath\M yFile.xls' could not be found.
Thanks in advance for any suggestions.
having very much luck. Can anyone help?
This works:
retval = Shell("""Excel. EXE"" ""C:\Progra m files\MyPath\My File.xls""",
1)
This does not like the space in 'Program Files':
retval = Shell("Excel.EX E " & Application.Cur rentProject.Pat h &
"\MyFile.xl s", 1)
I've tried quotation marks all over the place in all sorts of
combinations and cannot get it to work. With the above example I get
the following message:
'C:\Program.xls ' could not be found...
That one is immediately followed by:
'Files\MyPath\M yFile.xls' could not be found.
Thanks in advance for any suggestions.
Comment