I've got an interesting problem.
A macro I've made loops over pictures on a worksheet, copies and pastes them (PasteSpecial) to another cell in the sheet. This is working fine with Excel 2011, 2007, and 2013 on a faster computer, but in my testing I've found that the PasteSpecial method fails on a slow computer. This is in Excel 2010, and since this macro's working fine in Excel 2007 and 2013, I assume that the version of Excel isn't the problem (please correct me if that's a bad assumption).
To clarify, pictures are copied with .Copy, and immediately pasted with .PasteSpecial into another cell, but on the slow computer i get an error 1004, pastespecial failed for range object (since they're being pasted to a particular cell referenced as a range).
Here's the interesting part: If i put a message box (empty or not) right after the copy command, and sit there clicking ok over and over, then the error is never thrown, and everything works fine (as with the other 3 Excel versions tested).
I think the msgbox is just giving the slow computers clipboard time to catch up to what's going on, since excel would be waiting for itself if it had stuff to do but might not be smart enough to wait for the slow write speed of the computer itself.
Is there a way to test if the computers busy so I can make excel wait until the clipboard is caught up? Or maybe test the contents of the clipboard so excel waits until there's actually something to paste?
Or some other creative solution would be sweet!
Thanks,
Tim
Bookmarks