How can i get a list of all available Sheet names for my excel file using ActiveX Object?
I know this code Excel.ActiveWorkBook.Sheets
returns the sheets... But how could I get the NAMES of these sheets in an array?
function getTabs()
{
var w =new ActiveXObject("Excel.Application");
var book = w.Workbooks.Open(excelFile);
alert(book.name); //here I get the filename of my xls file and it displays ok
var ExcelSheet= book.Sheets;
alert(ExcelSheet); //This alerts to 'undefined'
w.Quit();
w=null;
}
This is my code right now.....
ok, after a lot of trial and error i have come to an answer that works:
Since there are not many easy options in Sheets or Worksheets collections, you can do a simple loop: