Invalid Procedure Call or Argument using Shell command (1 Viewer)

mikebrewer

Registered User.
Local time
Today, 04:58
Joined
Sep 28, 2011
Messages
93
Hi all,

I'm developing an application where I want to call the keyboard up on the screen when a user enters a field. This is my setup:

Windows 8.1 32 Bit, Access Runtime 2010.
Exact lines of code are:

Dim RetVal
RetVal = Shell("C:\Program Files\Common Files\microsoft shared\ink\TabTip.exe")

These lines of code work perfectly fine on my development PC which is running Windows 7 64 bit, Access/Office 32 bit.

I know the path to the exe is good. I can navigate and double click it and it works great. but the shell command is resulting in the invalid procedure. I have no idea what I'm doing wrong and the last few hours of searching google have led to nothing. :banghead::banghead::banghead:

Any help would be greatly appreciated.
 

spikepl

Eledittingent Beliped
Local time
Today, 10:58
Joined
Nov 3, 2010
Messages
6,142
Your path contains blanks and must therefore be wrapped in " You can try this by typing the string in the command prompt. You must therefore pass " to the Shell like this:

RetVal=Shell("""mypath""")
 

mikebrewer

Registered User.
Local time
Today, 04:58
Joined
Sep 28, 2011
Messages
93
So I went ahead and changed it over to this:

Dim RetVal
Dim Path As String

Path = """C:\Program Files\Common Files\microsoft shared\ink\TabTip.exe"""
RetVal = Shell(Path)

Still failing with the same error message. Again, it works absolutely PERFECT on my windows 7 test machine. But as soon as I try it on Windows 8, it fails with that message.
 

mikebrewer

Registered User.
Local time
Today, 04:58
Joined
Sep 28, 2011
Messages
93
I even tried switching over my Path to C:\Windows\System32\osk.exe and that also fails. (I was not sending over the " with that path since there is no space in the path name).

Thanks again!
 

mikebrewer

Registered User.
Local time
Today, 04:58
Joined
Sep 28, 2011
Messages
93
As a placeholder/work around, i just did this:

Dim RetVal
Dim Path As String

Path = "C:\HaulTime\Keyboard.bat"
RetVal = Shell(Path, vbMinimizedNoFocus)

The Keyboard.bat file only has one command and that is:

"C:\Program Files\Common Files\microsoft shared\ink\TabTip.exe"

This works and brings up the keyboard. Doesn't really explain why it didn't work before but at least it is a work around for the time-being.

Thanks!
 

Users who are viewing this thread

Top Bottom