Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid procedure call or argument on appactivate 1

Status
Not open for further replies.

rahrah716

Technical User
Sep 26, 2000
2
US
I'm trying from VB 6.0 to return to an app I previously launched to send some keystrokes. I think I'm correctly following the examples I've seen:

dim NetscapeWindow as long
sn={full pathname of netscape.exe}+{full pathname of local HTML file}

NetscapeWindow = Shell(sn, vbNormalFocus)

This works fine

Later on:

AppActivate NetscapeWindow

produces "Invalid procedure call or argument (Error 5)"

Any suggestions?
[sig][/sig]
 
rahrah,

There is a slight bug in the help file concerning AppActivate. It says the syntax is:

AppActivate Title

Where title can be a string or a long with the window ID.

What you really need is:

AppActivate (Title)

Minor detail! Then it will work with either the window ID or a string containing the start of the window title. If you code it that way, you will only get an error 5 if the Netscape app has been closed. [sig][/sig]
 
AppActivate (Title)

or

AppActivate (Title), True

These both work, thanks. [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top