D
Duong Tran via AccessMonster.com
Hi All,
This problem is similar to the one Brian posted, see http://www.accessmonster.com/Uwe/Forum.aspx/access-externaldata/2381/Excel-Still-running
However, I've tried the suggestion without success. Please can someone tell me what I'm doing wrong with the following code segment that keep leaving Excel running in memory.
BTW: I'm using Access & Excel 2000 on an XP home OS.
I've also tried objExcel.Worksheets(strSheet).Activate
Thanks in advance,
Duong.
-------------------------- codes start
Dim msExcel As Excel.Application
If AppIsActive("Excel") Then
Set objExcel = GetObject(Class:="Excel.Application")
Else
Set objExcel = CreateObject(Class:="Excel.Application")
End If
objExcel.Visible = False
objExcel.Workbooks.Open strSource
objExcel.Worksheets(strSheet).Select
DoCmd.TransferSpreadsheet acImport, 8, strTable, strSource, True, ""
Do While objExcel.Workbooks.Count > 0
objExcel.Workbooks(1).Close False
Loop
If boolXL Then objExcel.Quit
Set objExcel = Nothing
-------------------------- codes end
This problem is similar to the one Brian posted, see http://www.accessmonster.com/Uwe/Forum.aspx/access-externaldata/2381/Excel-Still-running
However, I've tried the suggestion without success. Please can someone tell me what I'm doing wrong with the following code segment that keep leaving Excel running in memory.
BTW: I'm using Access & Excel 2000 on an XP home OS.
I've also tried objExcel.Worksheets(strSheet).Activate
Thanks in advance,
Duong.
-------------------------- codes start
Dim msExcel As Excel.Application
If AppIsActive("Excel") Then
Set objExcel = GetObject(Class:="Excel.Application")
Else
Set objExcel = CreateObject(Class:="Excel.Application")
End If
objExcel.Visible = False
objExcel.Workbooks.Open strSource
objExcel.Worksheets(strSheet).Select
DoCmd.TransferSpreadsheet acImport, 8, strTable, strSource, True, ""
Do While objExcel.Workbooks.Count > 0
objExcel.Workbooks(1).Close False
Loop
If boolXL Then objExcel.Quit
Set objExcel = Nothing
-------------------------- codes end