Hi,
I've seen several references to similar problems online, but none of them seem to match exactly what I'm experiencing, so:
I've got two workbooks, and I'm copying data from one to another. The user selects one or more cells in a single column in one workbook, runs my macro and the data is copied into a certain place in the other one. By the time the code hits a problem, the cells have been copied to the clipboard, the other workbook has been activated, and I'm about to select a blank cell at the bottom of the ActiveSheet where I want to paste the data in one chunk, ready to move it into the appropriate places. Here's the problem code:
This works fine if they select just one cell, but if they select two or more, the code fails on the ActiveSheet.Paste line, with the error message 'Paste method of worksheet class failed'. Oddly, the data are pasted in successfully before the error message is thrown. If I stop the code before the problem line and run a Paste manually, it works fine. Oh, and the error is still thrown if I select more than one cell before pasting.![]()
bottom = ActiveSheet.UsedRange.Rows.Count + 2 Range("A" & bottom).Select ActiveSheet.Paste
Suggestions welcomed, thanks. I'm not an expert on VBScript, so keep 'em simple, please!
Bookmarks