+ Reply to Thread
Results 1 to 15 of 15

Application.SendKeys Alt Tab Not working

  1. #1
    Forum Contributor
    Join Date
    08-16-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2019
    Posts
    209

    Application.SendKeys Alt Tab Not working

    Hi,

    I have two Excel spreadsheet that i want to rotate to get data and paste it.
    something like this (Alt Tab to spreadsheet 2 > Select sheet xyz > copy range > Alt tab to spreadsheet 1 > paste range) 20 times.

    However i got an error at selecting worksheet (it seems like i am not in the spreadsheet 2 when application.send key got execute.)

    error at sheets("CROSSTAB_1").select

    Please Login or Register  to view this content.
    any help would be appreciated.

    Thanks
    Lex

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Application.SendKeys Alt Tab Not working

    Hello lexusap,

    Are you not maybe over complicating things a little? This can be done without Alt Tab and Send Keys.

    Attach a sample workbook (not a picture or pasted copy).

    Make sure there is just enough data to demonstrate your need.

    Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Application.SendKeys Alt Tab Not working

    .
    Hey Winon. You are up late ? early ?

  4. #4
    Forum Contributor
    Join Date
    08-16-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2019
    Posts
    209

    Re: Application.SendKeys Alt Tab Not working

    how would you do it without using send keys?
    I want to make it as simple as possible to the end user, where they do not need to save the workbook , and using alt+tab copy paste would be a quick solutions.

    Let me know what you think.

  5. #5
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Application.SendKeys Alt Tab Not working

    Hi lexusap,

    I want to make it as simple as possible to the end user, where they do not need to save the workbook...
    Exactly my point as well, but I don't know what else you may have in the Workbook, hence my request for a sample. It makes it much easier for us to assist, if you could attach a sample, instead of us having to create one based on guessing your setup, etc.

    Regards.

  6. #6
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Application.SendKeys Alt Tab Not working

    @ Logit,

    Hey there Buddy!

    Yip, up since just after midnight with a toothache, and now you to make me even more miserable!

    If i am up early, maybe that means you are up late?

    Your'e o.k.?

  7. #7
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Application.SendKeys Alt Tab Not working

    .
    Almost sleep time here for me. Sorry about your tooth.

    Drink some home brew. Works every time !

  8. #8
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Application.SendKeys Alt Tab Not working

    The only brew I really enjoy, is a cuppa Java. Hate the taste of alcohol, although I may have some on occasion. But very seldom.

  9. #9
    Forum Contributor
    Join Date
    08-16-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2019
    Posts
    209

    Re: Application.SendKeys Alt Tab Not working

    Hi,

    please see sample data, open up Hymix market data, select Macro and click on button Copy.

    Thanks
    Lex

  10. #10
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Application.SendKeys Alt Tab Not working

    Thank you lexusap,

    Its about time.

    I'll have a look, and get back to you, also taking my time. LOL

  11. #11
    Forum Contributor
    Join Date
    08-16-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2019
    Posts
    209

    Re: Application.SendKeys Alt Tab Not working

    Cheers - thanks Winon.

  12. #12
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Application.SendKeys Alt Tab Not working

    Hi lexusap,

    In your original Post you refer to two Worksheets, when in fact it is actually two Workbooks. Big difference!

    In your "Sub Macro2marketdata" you refer to "Hymix Market Data - JAN 18.xlsx", while you only have "Hymix Market Data - MAY18.xlsm"

    Your Code will therefor not be able to locate "Hymix Market Data - JAN 18.xlsx"

    Thus far my findings. Can you please clarify a bit more?

    This may take longer to resolve with two Workbooks as opposed to Two Worksheets in one Workbook.

    Thank you

  13. #13
    Forum Contributor
    Join Date
    08-16-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2019
    Posts
    209

    Re: Application.SendKeys Alt Tab Not working

    didn't realise i said 2 spreadsheets.. whoops my bad.

    The naming of the workbooks will be replace by combo of Alt+Tab.

    can i ask whether the first 13 line of code Macro1 works?

    Please Login or Register  to view this content.
    Thanks
    Lex

  14. #14
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Application.SendKeys Alt Tab Not working

    Sorry lexusap,

    Certain "Powers" on this forum do not appreciate me contributing the way I do, and I have decided to rather withdraw from this and all other Threads with immediate effect.

    I trust someone else will come to your rescue.

    So long!

  15. #15
    Forum Contributor
    Join Date
    08-16-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2019
    Posts
    209

    Re: Application.SendKeys Alt Tab Not working

    No worries. i think there is some misunderstanding that the macro i am referring to is called "Macro1" on Module 2 rather than "Macro2marketdata" on Module 1.

    Cheers

+ 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. [SOLVED] Application.SendKeys F1
    By brentjohn in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-15-2018, 12:18 PM
  2. Application.sendkeys help
    By viruzman in forum Excel General
    Replies: 1
    Last Post: 03-26-2008, 10:13 PM
  3. Application.SendKeys stopped working
    By bondcrash in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-17-2007, 03:27 PM
  4. SendKeys to open application
    By Arne Hegefors in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-15-2006, 04:37 AM
  5. [SOLVED] Close an application with sendkeys
    By ina in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2006, 03:20 AM
  6. The application SendKeys
    By Jim333 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-17-2005, 12:44 AM
  7. SendKeys and Application.ScreenUpdating
    By Michael Malinsky in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-23-2005, 07:06 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