Solved

Invalid Procedure Call or Argument Message

Posted on 2011-02-24
7
593 Views
Last Modified: 2012-05-11
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

0
Comment
Question by:pcalabria
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 75
ID: 34975982
Does that path and file already exist ?

mx
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34976173
try this


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

Author Comment

by:pcalabria
ID: 34976443
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
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34976456
who is Capacorn?
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 34976493
replace "notepad "  with "explorer "
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34976610
you can also use

followhyperlink strAppName
0
 

Author Comment

by:pcalabria
ID: 34977038
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!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question