In Access, I use the following to refer an Excel file:
How can I refer to the first worksheet, irrespective of its name?
Thanks in advance
Code:
Dim xlApp As Excel.Application
Dim xlWB As Excel.Workbook
Dim xlWS As Excel.Worksheet
Set xlWB = Workbooks.Open(filename)
Set xlApp = xlWB.Parent
Set xlWS = xlWB.Worksheets("Data")
How can I refer to the first worksheet, irrespective of its name?
Thanks in advance