ExcelRooky91
New Member
- Joined
- Apr 3, 2018
- Messages
- 10
Hi guys,
I'm scratching my head a little bit with this error. The VBA code I have, which pastes a screenshot, is as below. What I'm finding is that it is very temperamental. Some days the code works fine. Other days it comes up with the error as shown in the title. After pasting the screenshot, the next Sub saves and closes the workbook. However, if an error occurs, this ofcourse does not happen.
Is anyone able to elaborate/provide a better solution?
Any help is much appreciated.
Kind regards,
Ty
I'm scratching my head a little bit with this error. The VBA code I have, which pastes a screenshot, is as below. What I'm finding is that it is very temperamental. Some days the code works fine. Other days it comes up with the error as shown in the title. After pasting the screenshot, the next Sub saves and closes the workbook. However, if an error occurs, this ofcourse does not happen.
Is anyone able to elaborate/provide a better solution?
Any help is much appreciated.
Kind regards,
Ty
HTML:
Sub Pastepic()
Windows("BKBM Workbook.xlsm").Activate
ActiveSheet.Paste Destination:=Worksheets("Sheet1").Range("a4")
Range("A1:B2").Select
Selection.Copy
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False