Hey John,
Well I'm back. I considered starting a new thread but figured you're already familiar with the program.
I am having problems with one section in Module1. I receive the error "PasteSpecial method of Worksheet class failed" and then the section below highlights.
ActiveSheet.PasteSpecial Format:="Bitmap", Link:=False, DisplayAsIcon:=False
A blank Excel sheet displays with nothing on it.
Here it is in the context (full module):
Option Explicit
Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Public Const VK_SNAPSHOT = 44
Public Const VK_LMENU = 164
Public Const KEYEVENTF_KEYUP = 2
Public Const KEYEVENTF_EXTENDEDKEY = 1
Sub Create_UFImage()
DoEvents
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY + KEYEVENTF_KEYUP, 0
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY + KEYEVENTF_KEYUP, 0
Application.ScreenUpdating = False
DoEvents
Workbooks.Add
Application.Wait Now + TimeValue("00:00:01")
ActiveSheet.PasteSpecial Format:="Bitmap", Link:=False, DisplayAsIcon:=False '<-- Problem here
ActiveSheet.Range("A1").Select
ActiveSheet.PageSetup.Orientation = xlPortrait
ufEntryForm.Hide
Call image
ActiveWorkbook.Close False
Application.ScreenUpdating = True
End Sub
Ideas?
Bookmarks