Excel 2007
I know this error has been solved many times before, but I have only seen workarounds, and my script requires an actual solution.
I am running a VBA script in excel that copies (10-600) lines of information from a webpage and then pastes that into excel. The pulled information contains headers and tables, and excel nicely keeps their format when I paste.
The paste works fine except for a random "runtime error 1004 paste method of worksheet class failed." As other posters have noted, the error goes away if you just hit 'Debug' and press play again. I could live with that myself, but this script will be used by others.
The solutions on forums say to assign the cells the string instead of copy-paste into it. That's a great solution for them, but doesn't work for me because I need to keep the formatting from an external source (webpage). So the following does not work, it just puts everything into one column:
![]()
Please Login or Register to view this content.
So here's my code:
![]()
Please Login or Register to view this content.
Bookmarks