I have a module which opens multiple Excel workbooks and then reads data from different sheets within the workbook, then transfers the data to a table.
I'm using :-
Set xlobject = CreateObject("Excel.Application"
'this is where we open the Excel spreadsheet
'
xlobject.Application.Workbooks.Open ExcelName
'specify the first sheet
StrExcelTab = "Trans-Dir"
Set xlsheet = xlobject.Application.activeworkbook.sheets(StrExcelTab)
:- to open the workbooks
and :-
DoCmd.SetWarnings False
xlobject.Application.Quit
Set xlobject = Nothing
DoCmd.SetWarnings True
:- to close the workbook
but the Excel program is still left running when the code has executed. Even worse there is a instance of Excel for every call to open a workbook ( 24 in test mode ).
Am I missing some code to close Excel completley after each pass through the workbook ???
Steady ...![[thumbsup2] [thumbsup2] [thumbsup2]](/data/assets/smilies/thumbsup2.gif)
I'm using :-
Set xlobject = CreateObject("Excel.Application"
'this is where we open the Excel spreadsheet
'
xlobject.Application.Workbooks.Open ExcelName
'specify the first sheet
StrExcelTab = "Trans-Dir"
Set xlsheet = xlobject.Application.activeworkbook.sheets(StrExcelTab)
:- to open the workbooks
and :-
DoCmd.SetWarnings False
xlobject.Application.Quit
Set xlobject = Nothing
DoCmd.SetWarnings True
:- to close the workbook
but the Excel program is still left running when the code has executed. Even worse there is a instance of Excel for every call to open a workbook ( 24 in test mode ).
Am I missing some code to close Excel completley after each pass through the workbook ???
Steady ...
![[thumbsup2] [thumbsup2] [thumbsup2]](/data/assets/smilies/thumbsup2.gif)