Link to home
Start Free TrialLog in
Avatar of pcalabria
pcalabriaFlag for United States of America

asked on

Invalid Procedure Call or Argument Message

I'm running code which is generating the following message.  
Dim strAppName As String
   
    strAppName = "C:\database\temp.txt"
    Call Shell(strAppName, 1)

I'm pretty sure I've used this code before successfully, but its not working now.  Any ideas?

Thanks

Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Does that path and file already exist ?

mx
try this


Dim strAppName As String
   
    strAppName = "C:\database\temp.txt"
    Call Shell("notepad " & strAppName, 1)
Avatar of pcalabria

ASKER

mx,

Yes, I verified that the path and file do already exist.  However, I did try to simplify my problem in the question.  The actual file that I want to load uses an .htm extension and should open in my browser, Internet Explorer.

If I double click on the file from File Explorer, all opens as I would expect.  However, for some reason the command does not cause IE to open the file.  Even when I replace notepad in Capacorns example with IE.

Any ideas?

 I need to award Capacorn the points because the solution works, but I really want to open the .htm file in IE.  Can you still help?

Thanks
who is Capacorn?
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
you can also use

followhyperlink strAppName
capricorn1,

Sorry about the typos, I was sending from my PDA.
Not sure if I blame bad eyes or big fingers, but thanks for the help!