Shell command problem

Les Isaacs

Registered User.
Local time
Today, 21:45
Joined
May 6, 2008
Messages
186
Hi All

I have a function that creates an xml file in CurrentProject.path, which works fine. After creating the file I want to open it. I've tried
Code:
Shell ("c:\program files\internet explorer\iexplore.exe  CurrentProject.path & ""\"" & ""xmldemo.xml""")
and I've tried
Code:
fname = CurrentProject.path & "\" & "xmldemo.xml"
Shell ("c:\program files\internet explorer\iexplore.exe  fname")
but in each case internet expolrer opens but then give a message that it is unable to open the file:mad:. I can open the file directly from windows explorer (it opens with internet explorer).

Any ideas anyone:confused:
Thanks for any help.
Les
 
Because of the spaces you should place the command & filename between quotes and not the complete shell command:
Code:
Shell (chr(34) & "c:\program files\internet explorer\iexplore.exe" chr(34) & " " & chr(34) & fname & chr(34))
 
I take it you got your xml file built, and have moved on to the next stage.
you may be able to get what you want by simply

application.FollowHyperlink filename

it opens whatever programme is associated with the extension of the file. an xml file may be internet explorer, but may be some other xml viewer.
 
Last edited:
Hi Peter
Many thanks for that - worked perfectly (once I'd added the '&' before the first 'chr(34)';)

Hi Dave
Unfortunately not - I've yet to get down to the job of actually creating the recordset and assigning all the fields (but I'm confident of my ability to do so:)). Thanks for the FollowHyperlink tip - useful to know.

Les
 

Users who are viewing this thread

Back
Top Bottom