Results 1 to 3 of 3

Copy / Paste issue using SendKeys

Threaded View

hawkingsright Copy / Paste issue using... 05-20-2014, 01:38 PM
protonLeah Re: Copy / Paste issue using... 05-22-2014, 01:01 AM
hawkingsright Re: Copy / Paste issue using... 06-12-2014, 04:54 PM
  1. #1
    Registered User
    Join Date
    07-19-2012
    Location
    Kansas
    MS-Off Ver
    2000, 2007
    Posts
    15

    Copy / Paste issue using SendKeys

    hello all. i'm having a problem that i just can't seem to figure out. i'm using sendkeys to copy a spreadsheet to paint, and save it as a jpg in our html catalog's image file. when i run the macro from the spreadsheet, it works perfectly. when i run it from the userform, it puts a blank image into paint. the image is sized appropriately when paste is called, just blank. any ideas why this is happening? there's a lot of time delays in this to make sure it's going to function on some of the slow machines around here. any help is greatly appreciated.

    here's the code:

    Sub send_hw()
    'cp1 send
    Dim ActivatePaint
    'open paint
    ActivatePaint = Shell("C:\Windows\system32\mspaint.exe", 1)
    Application.Wait Now + TimeValue("00:00:05")
    'copy/paste page
    Sheets("cp1").Activate
    Range("A1:J76").Copy
    Application.Wait Now + TimeValue("00:00:02")
    AppActivate (ActivatePaint)
    Application.Wait Now + TimeValue("00:00:02")
     SendKeys "^v"
     Application.Wait Now + TimeValue("00:00:03")
     SendKeys "%f"
     Application.Wait Now + TimeValue("00:00:01")
     SendKeys "a"
     Application.Wait Now + TimeValue("00:00:01")
     'tab to drive selection
     '  etc. etc.
    End Sub
    Last edited by hawkingsright; 05-20-2014 at 04:00 PM. Reason: shortened code for relavency

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. SendKeys Issue
    By pavel3002 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-08-2011, 05:35 PM
  2. copy and paste issue
    By dude2007 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-19-2008, 05:29 PM
  3. copy & paste issue
    By carterljohn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-30-2007, 10:06 PM
  4. Copy & Paste issue
    By Johnny in forum Excel General
    Replies: 1
    Last Post: 11-30-2005, 11:25 AM
  5. [SOLVED] Sendkeys issue
    By Michael Malinsky in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-04-2005, 03: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