I have a script that takes an excel workbook and turns all formulas into values. I have used it successfully in the past, but am receiving the following error on spreadsheets I am need to convert to values:
Run-time error '1004': Method 'Select' of object 'Sheets' failed
Debug stops on the first line Worksheets.Select
...
Worksheets.Select
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
ActiveSheet.Select
Application.CutCopyMode = False
Given the fact that this script does work on other workbooks I have a few ideas on why I get the error. In the workbooks with errors I have hidden sheets. That may be part of the issue. I need this to work on workbooks with hidden sheets. Thank you for your ideas and suggestions on troubleshooting this.