I need to open a particular sheet in an excel workbook. I tried:
Set wbk = appExcel.Workbooks.Open(strImportFile)
Set wks = wbk.Worksheets(rstImportSpec!SheetName)
where SheetName = 'Main Page' but I get a 'Type Mismatch' error
However Set wks = wbk.Worksheets(1) works perfectly. The problem is sometimes the sheets are not all the same in all workbooks but the particular Sheet Name always exists
what am I doing wrong?