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
Bookmarks