3
votes

I'm trying to copy a worksheet from workbook into another using Worksheets.Copy function. However, this seem to be working in only some of the files and for others I get "Unable to get the Copy property of the Worksheet class" error message. I've tried to copy/move worksheets manually from other workbooks. Also, tried unprotecting/protecting workbook and worksheets but none seem to be working. I'm using Microsoft Office 2010. Is there an Excel feature that enables/disables copying worksheets form other workbooks?

3
Did you ever find a solution?IngoB
No, but there's manual workaround.DataPispor

3 Answers

1
votes

In case someone stumbles upon this in the future, my issue was that the worksheet I was trying to copy was set to 'xlSheetVeryHidden'. To overcome this issue, I temporarily made the sheet visible and made it hidden again straight after the Copy call.

templateWorksheet.Visible = xlSheetVisible
Call templateWorksheet.Copy
templateWorksheet.Visible = xlSheetVeryHidden
0
votes

In my case the issue was that I had not been working with the worksheet but the workbook. Make sure you are using the worksheet and not the book.

-1
votes

In my case, the Excel file was not enabled for editing. Once I did that, it worked.