(Continuation of http://www.experts-exchange.com/Databases/MS_Access/Q_21182166.html
I use the following lines to open a text file using Shell, and it works fine...
sShellPath = "Notepad.exe " & Chr(34) & sDestinationPath & Chr(34)
dbl = Shell(sShellPath, vbMaximizedFocus)
This works great for Notepad, but if I try this with any other Office document (removing the "Notepad.exe"), I get a "Invalid procedure call or argument" runtime error #5. If I put in the full path/file of Word, Excel, etc. it works fine.
So... either is there another way to do this without getting the file locations of Word, Excel, etc., or how can I programmatically get these file locations?
I'm using Windows XP SP2/Office XP
Thanks in advance.