MisterMayhem869
New Member
- Joined
- Mar 10, 2023
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
I am trying to copy just the data to a new workbook. The source sheet is protected, the new workbook does not need to be. I am using the following code:
Sub CopyWorksheetValues()
Application.CopyObjectsWithCells = False
ActiveSheet.Copy
Cells.Copy
Range("A1").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End Sub
It does create the new workbook however I get a runtime error I would like to get rid of. I have experimented with ActiveSheet.Unprotect but have not had any luck so far. Any help would be gretly appreciated.
Sub CopyWorksheetValues()
Application.CopyObjectsWithCells = False
ActiveSheet.Copy
Cells.Copy
Range("A1").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End Sub
It does create the new workbook however I get a runtime error I would like to get rid of. I have experimented with ActiveSheet.Unprotect but have not had any luck so far. Any help would be gretly appreciated.