tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,924
- Office Version
- 365
- 2019
- Platform
- Windows
What is wrong with the following?
I get a Run-time error '9', subscript out of range error.
Thanks
I get a Run-time error '9', subscript out of range error.
Code:
Workbooks.Open "C:\Files\MyWorkbook.xlsx"
Dim a As Long
a = Workbooks("C:\Files\MyWorkbook.xlsx").Worksheets.Count
Thanks