Is it possible to switch worksheets within a workbook in a WSH VBScript (referenced by name) and if so, how would I do it?
This will be used in a script that already opens an Excel file. I want to access a worksheets called "Version Control".
The following is how I am opening the workbook:
xlsFile = path & "\xml-sitemap.xls"
Set objExcel = WScript.CreateObject("Excel.Application")
objExcel.Workbooks.open(xlsFile)
When automating Excel from VBScript, the global objects provided by Excel to VBA code are missing. So a minimal "work with sheets" script should look like:
This will do it (amended following Ekkehard.Horner's comment)
Using VBScript, you can return the name of the tab of an Excel spreadsheet with the ".name" extension.