+ Reply to Thread
Results 1 to 7 of 7

Opening "On-Screen Keyboard" in Windows 8 using VBA

  1. #1
    Registered User
    Join Date
    04-07-2013
    Location
    Elk Grove, CA
    MS-Off Ver
    Excel 2010
    Posts
    11

    Opening "On-Screen Keyboard" in Windows 8 using VBA

    I'm trying to open the MS On-Screen keyboard from an Excel user form using a command button. This is on a Windows 8 32 bit OS using Excel 2010. The code below works in windows 7 but not in Windows 8 for some reason
    code:
    Please Login or Register  to view this content.
    but when I transfer the form to the windows 8 machine I receive an error. I have also tried several other codes but I continue to receive the error "Invalid procedure call or argument".

    has anyone been able to open the windows 8 On-Screen Keyboard using vba

    Thanks
    Scott

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Opening "On-Screen Keyboard" in Windows 8 using VBA

    Hi Scott,

    After some searching and trying I get this answer.

    Please Login or Register  to view this content.
    Look on : http://www.vbaexpress.com/forum/arch...p/t-34397.html where there are a few different attempts to make it work.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    04-07-2013
    Location
    Elk Grove, CA
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Opening "On-Screen Keyboard" in Windows 8 using VBA

    Thanks for the response Marvin.

    I tried the code you were kind enough to provide and receive the error "sub or function not defined"
    I also tried tried the code from the linked site. Also would not work.

    osk does exist in the specified location and the on-screen keyboard can be opened. Just not through vba!

    I wonder what changed that it works perfectly under windows 7 but not windows 8?

    I've spent hours trying to figure this out obviously without success.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,274

    Re: Opening "On-Screen Keyboard" in Windows 8 using VBA

    It's a UAC issue - the ShellExecute code in Marvin's link should work for you.
    Remember what the dormouse said
    Feed your head

  5. #5
    Registered User
    Join Date
    04-07-2013
    Location
    Elk Grove, CA
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Opening "On-Screen Keyboard" in Windows 8 using VBA

    Thanks for the response RS,

    I reset my user account control to the lowest setting (never notify) but it still won't function. This was not an issue with Win7 but Win8 =):

    Is there another setting in the UAC other than the lowest security setting that should be used?

    This shouldn't be this hard.

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,274

    Re: Opening "On-Screen Keyboard" in Windows 8 using VBA

    The ShellExecute code worked for me in Win 8 as provided in that link. I have not, as far as I recall, altered the UAC on this machine - using other methods pops up a prompt confirming whether to run the keyboard, but the ShellExecute simply works. (I am however using an admin account)

  7. #7
    Registered User
    Join Date
    04-07-2013
    Location
    Elk Grove, CA
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Opening "On-Screen Keyboard" in Windows 8 using VBA

    I was able to get the code to work! I had to add "ActiveWorkbook" for it to work. Without it I received "Sub or Function not defined"

    The code functioned both in this format
    Please Login or Register  to view this content.
    and this also worked
    Please Login or Register  to view this content.
    Written this way, I do receive the MS Warning that some files can contain viruses etc. Would you like to open this file? which is annoying, but it does open the keyboard!

    Thank you Marvin and RS, I doubt I (ok, never) would have ever figured this out without your help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1