I'm using the following code to copy paste from one workbook to another, and it gets hung up on the line in bold -- with Run-Time error 1004. I use this code on a half dozen workbooks, but this is the only one where it doesn't work.

In this workbook, I use Power Query to pull data from a SQL database into this workbook, and that seems to be the problem. I copied the data to a new workbook, and the code worked great. But when I pulled the Power Query back into the mix, sure enough...run-time error 1004. So I'm pretty sure that's the issue.

Please Login or Register  to view this content.

This is the last step in a long macro, and everything before it works just fine. What is it about this code set that doesn't want to coexist with Power Query?