I'm new to VBA for Excel and I'm trying to use the Excel object model to determine if a Workbook contains a specific worksheet. I'm trying to use the Names property to get the list of worksheets so I can search the list.
However, I cannot get the syntax correct for this command to work.
I can get the Counts property to work:
Set OApp = CreateObject("Excel.Application")
OApp.Workbooks.Open "c:\myexcel.xls"
RS = OApp.ActiveWorkbook.Worksheets.Count
OApp.Quit
And have working code for inserting a column into a worksheet (the true goal of this whole task).
But..I can't get Names to work.
Thanks,
- Phillip
However, I cannot get the syntax correct for this command to work.
I can get the Counts property to work:
Set OApp = CreateObject("Excel.Application")
OApp.Workbooks.Open "c:\myexcel.xls"
RS = OApp.ActiveWorkbook.Worksheets.Count
OApp.Quit
And have working code for inserting a column into a worksheet (the true goal of this whole task).
But..I can't get Names to work.
Thanks,
- Phillip