+ Reply to Thread
Results 1 to 2 of 2

SendKeys

  1. #1
    Registered User
    Join Date
    01-10-2011
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    1

    SendKeys

    Hi all, thanks for your time.

    I have just started a new job (my first in a year thanks to the recession), and have been given a massive menial task. I have other work to do, and reckon I can so this with a macro. I have worked out exactly what keystrokes are needed and how to open a file that needs opening at one point, but I can't put it all together.

    I also read something about a wait command, which may be beneficial if the macro gets ahead of itself.

    Here is the code I have so far...

    Please Login or Register  to view this content.
    I've no idea if it needs a header or anything, I'm new to this. If this is a huge problem and can't easily be overcome, I apologise.

    Thanks in advance,

    Pete
    Last edited by PedroPietro; 01-10-2011 at 11:45 AM. Reason: Bad title

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

    Re: Advice needed with macro programming (specifically SENDKEYS)

    Hi Pete and welcome to the forum,

    If you are pulling stuff into Excel and all is in Excel then VBA commands are a lot safer. Start the Macro Recorder and go through your keystrokes from above. Then read the Macro and what it thinks you did. Then modify it to work with variable rows or columns of data. This is much, much prefered to the SendKeys method.
    Read http://www.anthony-vba.kefra.com/vba/vbabasic1.htm
    If you do need SendKeys you may need to use "DoEvents" code also.
    Read: http://support.microsoft.com/kb/179987

    My suggestion is to not use Sendkeys and learn some VBA using the first link above.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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