+ Reply to Thread
Results 1 to 5 of 5

copy, ALT-Tab, Paste... SENDKEYS? APPACTIVATE?

  1. #1
    Registered User
    Join Date
    08-09-2019
    Location
    Maine
    MS-Off Ver
    2013
    Posts
    2

    Question copy, ALT-Tab, Paste... SENDKEYS? APPACTIVATE?

    I have joined this message board after trying for a couple weeks to figure this out. I have read a ton a messages on many different site, and still can't seem to figure this one out... Thank you in advance for any help guys!
    Sooooo..... Work at distribution center in Customer service. 2 monitors running windows, however our order entry runs in DOS.
    There are a few long sentences that I have to type, during the day, doing various request..
    IE: checking stock and ETA, please and thank you, Jordan. First I made an excel Doc with all of these in their own cell. All day long I click the cell, Ctrl-C, ALT-TAB, ALT-V (Paste in dos) CTRL-V in dos crashes the program and is a HUGE issue.
    MY goal- is to click a cell, have it copy, switch to previous window, and paste.
    I'm not even sure it's possible, I see people talking about "SendKeys" I'm super new to VBA and don't seem be able to figure it out.
    So far....
    I right clicked on Sheet 1 and went to view code. and pasted this in
    Please Login or Register  to view this content.
    That copies the cell when I click it(which is saving a little time, but I'm unable to figure out what is next, to switch to previous dos window, and paste (ALT-V)

    Again, any help would be much appreciated
    Last edited by Jeasy; 08-09-2019 at 05:12 PM.

  2. #2
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: copy, ALT-Tab, Paste... SENDKEYS? APPACTIVATE?

    I haven't really used Sendkeys, and on the surface it seems like it can work for you, but then I read some of the odd behaviors, so it is hard to recommend. But, certainly start there and see how far it takes you. It seems the preferred coding environment for this type of request is .net, but that opens up another set of worms. Maybe find a .net forum that is willing to help you if this proves to be a dead end.

    Alternatively, I know there are some apps/keyboards that let you set up macros that essentially type the commands you want. Gaming keyboards tend to have these abilities. That may be a cleaner solution. One app I found was MacroExpress. I don't know how legit it is, but it shows that there are some other solutions out there.
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

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

    Re: copy, ALT-Tab, Paste... SENDKEYS? APPACTIVATE?

    Hello Jeasy,

    Welcome to the forum!

    DOS windows or Command Prompt windows do not operate the same as a standard window. This is way Ctrl+V fails to paste the text. SendKeys will also fail since the DOS window is not in the same process as the Workbook.

    To paste text into a DOS windows requires using Windows API. The macro below will paste the data in cells "A1:A2" of the ActiveSheet. You can change this range to what you are using. The cells contents will be pasted to the DOS window and executed.

    Add a new VBA Module to your Workbook's VBA project. Copy and paste all of the code below into it.

    Please Login or Register  to view this content.
    Change the range and worksheet to match what you are using.
    Please Login or Register  to view this content.
    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!)

  4. #4
    Registered User
    Join Date
    08-09-2019
    Location
    Maine
    MS-Off Ver
    2013
    Posts
    2

    Re: copy, ALT-Tab, Paste... SENDKEYS? APPACTIVATE?

    I work on this in between calls at work, It will definitely take some time, but this looks like a HUGE step in the right direction. Thank you so much! I'm amazed at how generous you guys are with your time and effort! I will keep you posted.
    THANK YOU AGAIN!

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

    Re: copy, ALT-Tab, Paste... SENDKEYS? APPACTIVATE?

    Hello Jeasy,

    You're welcome. This is the first time anyone has wanted to this that I know of and I have never seen code to do it. I learned a lot by doing this, so thanks for that.

+ 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. Replies: 3
    Last Post: 01-01-2015, 06:26 AM
  2. How do I make the copy/paste of one column contingent on the copy/paste of another?
    By Kwasimitsu in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-23-2014, 01:51 PM
  3. [SOLVED] Copy Paste Loop ends before copy/paste is finished
    By brgr4u in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-08-2013, 04:01 PM
  4. Automate copy and paste and copy and paste back to excel
    By Bmw318be in forum Access Tables & Databases
    Replies: 0
    Last Post: 02-23-2013, 05:42 AM
  5. Replies: 1
    Last Post: 01-16-2013, 05:36 AM
  6. 2 Macro's: only vertical copy/paste action and copy-paste 14 columns to the right.
    By vdongen in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-08-2010, 10:34 AM
  7. Replies: 1
    Last Post: 01-04-2005, 06: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