Shell and Invalid procedure call or argument (1 Viewer)

toddred123

New member
Local time
Today, 04:06
Joined
Feb 23, 2014
Messages
3
Hello,
I'm pretty raw at this, but what I want to do is so simple.

Here's what I want to do:
I have a form with a button to print preview a report. This report needs one input parameter before executing. The computer this will run on is a touch screen and does not have a keyboard. Windows 7 has a "on screen keyboard" program. I want this to run first so that my user can input the parameter.

I have the following which throws an "Invalid procedure Call or Argument"

Sub CallTeclado()
Dim RetVal
RetVal = Shell("c:\windows\system32\osk.exe", vbNormalNoFocus)
End Sub

I'm stumped. Any thoughts?
 

toddred123

New member
Local time
Today, 04:06
Joined
Feb 23, 2014
Messages
3
This is a good start. Following the link you provided, I get this compile error:

The code in this project must be updated for use on 64-bit systems. Please review and update declare statements and then mark them with the PtrSafe attribute.

Which led to: support.microsoft.com/kb/983043

I pasted the code from above link into the declarations of a new module but still get compile error. Next step?
 

toddred123

New member
Local time
Today, 04:06
Joined
Feb 23, 2014
Messages
3
social.msdn.microsoft.com/Forums/vstudio/en-US/e9252bb7-1df0-4826-880f-ad0a636a18cd/error-when-opening-onscreen-keyboard-in-windows-7-could-not-start-onscreen-keyboard

This is an issue with 64-bit OS, it affects any 64-bit version of Windows.
Basically you are calling osk.exe, but your program you are calling it from is a 32-bit app. Windows won't allow you to call a 64-bit OSK.exe from your program. The comments appear to miss your point here, anyone can start osk.exe from Run, but call it from within a 32-bit application won't work in 64-bit Windows.
-----------
There is a simple workaround I will implement and come back to this later.

Thanks to spikepl for the assistance....
 

Users who are viewing this thread

Top Bottom