The below simple code run from personal will return a value of 1 regardless of the number of sheets in the workbook. The same macro copied to a module in a workbook returns the correct number of sheets.
Additionally all of the macros in my personal folder that use sheet counting code do not work, such as:
For Each WS In ThisWorkbook.Worksheets
ThisWorkbook.Worksheets.count
This is a new issue they have worked in the past. The personal folder is opening in hidden view and the workbook is not in edit mode.
What could have changed to create this issue?
Your assistance with correcting this is very much appreciated.
Ron
Additionally all of the macros in my personal folder that use sheet counting code do not work, such as:
For Each WS In ThisWorkbook.Worksheets
ThisWorkbook.Worksheets.count
This is a new issue they have worked in the past. The personal folder is opening in hidden view and the workbook is not in edit mode.
What could have changed to create this issue?
Your assistance with correcting this is very much appreciated.
Ron
Code:
Sub getSheetCount()
MsgBox ThisWorkbook.Worksheets.count
End Sub