+ Reply to Thread
Results 1 to 8 of 8

SendKey really working

Hybrid View

  1. #1
    Registered User
    Join Date
    11-16-2012
    Location
    Mos Eisly
    MS-Off Ver
    Excel 2007
    Posts
    39

    SendKey really working

    Hi,
    I need to automate some Work. currently I'm typing a command in an Application "Amadeus Altea". Than I copy/paste the result in an Excel Sheet, where I do some other analysis there.
    For the Analysis I have my macros and everything is working fine once the text got copied from Amadeus to excel.
    The thing is Including the command I'm typing in Amadeus is a Date , and I need to repeat each time the same command for every day for the next 3 months. and all this weekly.

    So far I managed to copy the command from excel to Amadeus (once it works fine I'll modify it so it generate the date automatic).
    My Problem is I got it to work from Excel to Amadeus but not vice versa.

    Here the code that work from Excel to Amadeus:
    Sub Amadeus()
    ActiveWorkbook.Activate
    Sheets(1).Activate
    Application.Wait Now + TimeValue("00:00:02")
    Range("A1").Activate
    Range("A1").Copy
    AppActivate "Altea Reservation Desktop"
    Application.Wait Now + TimeValue("00:00:02")
    SendKeys ("^v")
    SendKeys "{ENTER}"
    End Sub
    But I can't manage to get it work from Amadeus to Excel

    Sub Amadeus()
    AppActivate "Altea Reservation Desktop"
    Application.Wait Now + TimeValue("00:00:02")
    SendKeys ("^a")
    SendKeys ("^c")
    Application.Wait Now + TimeValue("00:00:01")
    AppActivate "Microsoft Excel"
    ActiveWorkbook.Activate
    Application.Wait Now + TimeValue("00:00:02")
    Set S2 = Worksheets("Result")
    S2.Activate
    Range("A1").Activate
    S2.Paste
    End Sub
    Except the SendKeys ("^v") and SendKeys "{ENTER}" nothing works, I tried by the way SendKeys ("Test") and it did work, but I can't manage SendKeys ("^a") or SendKeys ("^c") to work.

    In Amadeus you can hit Shift+Break and you would clear the entire Screen, even SendKeys ("+{BREAK}") didn't work.
    I have been told to use Sleep, which I tried, even by adding
    Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    but again nothing worked.

  2. #2
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    349

    Re: SendKey really working

    Try;

    Application.Sendkeys "^(a)"

  3. #3
    Registered User
    Join Date
    11-16-2012
    Location
    Mos Eisly
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: SendKey really working

    that was fast..but unfortunately it didn't work

  4. #4
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    349

    Re: SendKey really working

    Try;

    DoEvents
    SendKeys "^a"

  5. #5
    Registered User
    Join Date
    11-16-2012
    Location
    Mos Eisly
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: SendKey really working

    unfortunately no.. I see that the macro is doing something because the cursor in "Amadeus" change from initially █ to I
    But he don't select nothing and no copy as well. If I do manually Ctrl+a and Ctrl+c it works.

  6. #6
    Registered User
    Join Date
    11-16-2012
    Location
    Mos Eisly
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: SendKey really working

    I just did several tests, Ctrl + v and Ctrl + c, and Enter all are working fine.. the problem remains with Ctrl+a he just don't do the Select.. is there an alternative???

  7. #7
    Registered User
    Join Date
    11-16-2012
    Location
    Mos Eisly
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: SendKey really working

    Finally it works the problem was "A" (Ctrl+A). I tried it before with KeyPlusChar() .
    I never thought that changing to the capital letter would make a difference.

  8. #8
    Registered User
    Join Date
    11-23-2016
    Location
    egypt
    MS-Off Ver
    2016
    Posts
    1

    Re: SendKey really working

    please @Aranell can u send me the final script?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Sendkey Navigation
    By mtt23 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-26-2012, 06:20 AM
  2. Excel 2003 SendKey on XP not working
    By kales in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-08-2009, 09:20 AM
  3. sendkey for ALT+T
    By bobaftt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-01-2009, 11:00 AM
  4. SendKey {enter} on Website not working
    By bconner in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-20-2009, 11:38 AM
  5. [SOLVED] Sendkey
    By Jordan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2005, 11:15 PM

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