In researching this error I've come to the conclusion that it has to do with the clipboard not clearing like it should which wasn't an issue when we were using 2003 but is now that we are using 2010. (I also inherited this code from someone who doesn't work here anymore)
Run-Time error "4605":
This method or property is not available because the clipboard is empty or not valid.
This is my code:
Worksheets("Exec Sum").Range("B140:I186").Copy
With myDoc.Bookmarks
.Item("b3").Range.PasteSpecial Link:=True, DataType:=wdPasteMetafilePicture, Placement:=bmark, DisplayAsIcon:=False
End With
' Clears Clipboard
Application.CutCopyMode = False
I've tried sendkeys ("^C") with selecting an empty cell first but no luck. Is there any way that I could either not use the copy/paste method to do this or a different way to clear the clipboard?
I started getting this error when I upgraded from 2003 to 2010, but the macro still worked in 2003.
The tables were there, but I noticed that sometimes the copying didn't work. As this didn't ever happen in debug mode, I added 5 secs waiting time right before the copying.
This makes the macro slower, but at least it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With