+ Reply to Thread
Results 1 to 6 of 6

Excel 2003 SendKey on XP not working

Hybrid View

  1. #1
    Registered User
    Join Date
    10-07-2009
    Location
    Newport, NC
    MS-Off Ver
    Excel 2003
    Posts
    5

    Excel 2003 SendKey on XP not working

    I generated a spreadsheet app with VBA with DropDown List on my laptop (Vista OS) to user selection. Then using Sendkey I send out strings to be intrepreted by AutoHotKey scripts. This process works on laptop, but not on XP workstation at work.

    vbs script using: WshShell.SendKeys "%I" works on XP workstation but vba Sendkey command (SendKeys "%y") within Excel 2003 on XP workstation does not work.

    I'm using this with AutoHotKey scripts to call up a URL and various hotkey functions.

    This is in my AHK scrip file and it's looking for a Alt I

    !I::SendInput, {F6} http://www.google.com/search?q=GG&rl...e7&rlz=1I7ADBF {ENTER}

    Which Selects the Favorites tab on IE browser on XP instead of going to URL for Google.

    Please note AltI in vb script = %I

    I'm thinking I need to switch a setting in Excel.

    Also when sending SendKey (key strokes) to Notepad
    like BELL = WD6
    AutoHotKey switches BELL to WD6 but from XP while in Excel it only sends
    BELL and does not switch to WD6. But again this works correctly on laptop.

    The following vb script works on XP but not in Excel which switches a word to a code.
    WshShell.AppActivate "CMIS-COMTRAK Asset Information - Microsoft Internet Explorer provided by Serco Inc."
    WScript.Sleep 5000
    
    'WshShell.SendKeys "%y"
    'WScript.Sleep 1000
     WshShell.SendKeys "bell"
    Bell will automatically be switched to WD6 on laptop as vb script and in Excel in vba on laptop.

    Can anyone help?
    Last edited by Leith Ross; 10-07-2009 at 02:02 PM. Reason: Added Code Tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Excel 2003 SendKey on XP not working

    Hello kales,

    If you developed this on Vista and are attempting to run that code on Excel 2003, it is no surprise that you are having problems. To help avoid compatibility issues, with Vista there are many, you should develop your macros using the oldest version Excel you intend to run it on.

    Vista is the first OS platform to break with Windows traditional of backward compatibility. Windows 7 solves that problem by embedding Windows XP as a virtual OS. You can either rewrite the code using Excel 2003 on XP, or wait and upgrade to Windows 7.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    10-07-2009
    Location
    Newport, NC
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Excel 2003 SendKey on XP not working

    Hello Ross,

    Thanks for the input.

    Not sure what version of Excel, I'm running on Vista. I thinking it's Excel 2003. I will check tonight when I get home.

    If I am running Excel 2003 on Vista, are you still saying that Vista OS will give me problems when I save .xls and move it to the XP machine with Excel 2003.

    Also I'll try sending a SendKey on a new spreadsheet in Excel 2003 on XP workstation and see if I get the same problem.

  4. #4
    Registered User
    Join Date
    10-07-2009
    Location
    Newport, NC
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Excel 2003 SendKey on XP not working

    Ross,


    Just tried Wait 4 seconds followed by
    SendKeys "%y"

    on XP with VBA Excel 2003 button and it still tries to highlight File tab in the IE browser. I wanted to go to URL.



    Note: I wanted and needed to be on IE browser to call up a URL request.

  5. #5
    Registered User
    Join Date
    10-07-2009
    Location
    Newport, NC
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Excel 2003 SendKey on XP not working

    Ross,

    I was running Excel 2002 on laptop with Vista.

    I saw a post for a fix by using

    MySendKey procedures (.Bas extension) but I do not know how to call procedure within Excel VBA or if it was possible.

  6. #6
    Registered User
    Join Date
    10-07-2009
    Location
    Newport, NC
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Excel 2003 SendKey on XP not working

    Ross,

    Can I Call a vbs script from Excel VBA and pass parameter to it during Call.

    Since vbs script works, I was hoping this could be a solution to my problem?

+ 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