G
Gary Thompson
I have written a VBA program within Access 2003 to gather data from user
maintained spreadsheets. I am using the following code within a loop to
iterate through spreadsheets within a folder, open the sheet and extract
information into an Access database. Recently some of the spreadsheets have
returned an internal subscript out of range error, but only when opened via
the VBA program, NOT when opened from Windows Explorer. As you can see I am
disabling events when I open the sheets. Any suggestions?
Set apExcel = New Excel.Application
apExcel.EnableEvents = False
Set wkbk = Workbooks.Open(filename:=strFilename, UpdateLinks:=False,
ReadOnly:=True, _
Notify:=False)
wkbk.Worksheets("Base Data").Select
maintained spreadsheets. I am using the following code within a loop to
iterate through spreadsheets within a folder, open the sheet and extract
information into an Access database. Recently some of the spreadsheets have
returned an internal subscript out of range error, but only when opened via
the VBA program, NOT when opened from Windows Explorer. As you can see I am
disabling events when I open the sheets. Any suggestions?
Set apExcel = New Excel.Application
apExcel.EnableEvents = False
Set wkbk = Workbooks.Open(filename:=strFilename, UpdateLinks:=False,
ReadOnly:=True, _
Notify:=False)
wkbk.Worksheets("Base Data").Select