L
Luis
Hello.
I have a module that creates 2 different Excel application
objects. I create one object, process the object and do
set Wbxl=Nothing. I repeat the same process to the second
object.
The big problem is that only one of the objects is killed.
If i go to Windows Task Manager there is still one
Excel.Exe process. This causes that when i close the
database I get an Excel exception error.
Is it an Access bug or am i doing something wrong? The
code i'm using looks like this:
Public Function Process_cell()
Dim wbxl As Object
Dim wbxl2 As Object
Set wbxl = CreateObject("Excel.application")
Path = "mypath"
wbxl.DisplayAlerts = False
wbxl.Workbooks.Open Path
DoCmd.TransferSpreadsheet acImport,
acSpreadsheetTypeExcel9, "mytable1", "Path",
True, "A2:IV65536"
wbxl.ActiveWorkbook.Close savechanges:=False
wbxl.Quit
Set wbxl = Nothing
Set wbxl2 = CreateObject("Excel.application")
Path = "mypath2"
wbxl2.DisplayAlerts = False
wbxl2.Workbooks.Open Path
DoCmd.TransferSpreadsheet acImport,
acSpreadsheetTypeExcel9, "mytable2", "Path",
True, "A2:IV65536"
wbxl2.ActiveWorkbook.Close savechanges:=False
wbxl2.Quit
Set wbxl2 = Nothing
End Function
I have a module that creates 2 different Excel application
objects. I create one object, process the object and do
set Wbxl=Nothing. I repeat the same process to the second
object.
The big problem is that only one of the objects is killed.
If i go to Windows Task Manager there is still one
Excel.Exe process. This causes that when i close the
database I get an Excel exception error.
Is it an Access bug or am i doing something wrong? The
code i'm using looks like this:
Public Function Process_cell()
Dim wbxl As Object
Dim wbxl2 As Object
Set wbxl = CreateObject("Excel.application")
Path = "mypath"
wbxl.DisplayAlerts = False
wbxl.Workbooks.Open Path
DoCmd.TransferSpreadsheet acImport,
acSpreadsheetTypeExcel9, "mytable1", "Path",
True, "A2:IV65536"
wbxl.ActiveWorkbook.Close savechanges:=False
wbxl.Quit
Set wbxl = Nothing
Set wbxl2 = CreateObject("Excel.application")
Path = "mypath2"
wbxl2.DisplayAlerts = False
wbxl2.Workbooks.Open Path
DoCmd.TransferSpreadsheet acImport,
acSpreadsheetTypeExcel9, "mytable2", "Path",
True, "A2:IV65536"
wbxl2.ActiveWorkbook.Close savechanges:=False
wbxl2.Quit
Set wbxl2 = Nothing
End Function