X
xRoachx
In a module, I open an excel instance, do some operations, then close the
excel instance. At least, that's the intent of the module but I cannot get
the excel instance to close. Below are the relevant pieces of code. I would
like to know if I reference the objects correctly and if this is the source
of the problem. Also, I know I shouldn't use ActiveWorkbook, etc., but I am
the only user of the db so I figured I could manage it.
Dim objExcel As Excel.Application
Dim objWS As Excel.Worksheet
Dim objWB As Excel.Workbook
Set objExcel = GetObject(, "Excel.Application")
If Err.Number <> 0 Then
Err.Clear
Set objExcel = CreateObject("Excel.Application")
End If
Set objWB = objExcel.ActiveWorkbook
Set objWS = objWB.Sheets(1)
*** Code Here ****
objExcel.Quit
Set objWS = Nothing
Set objWB = Nothing
Set objExcel = Nothing
excel instance. At least, that's the intent of the module but I cannot get
the excel instance to close. Below are the relevant pieces of code. I would
like to know if I reference the objects correctly and if this is the source
of the problem. Also, I know I shouldn't use ActiveWorkbook, etc., but I am
the only user of the db so I figured I could manage it.
Dim objExcel As Excel.Application
Dim objWS As Excel.Worksheet
Dim objWB As Excel.Workbook
Set objExcel = GetObject(, "Excel.Application")
If Err.Number <> 0 Then
Err.Clear
Set objExcel = CreateObject("Excel.Application")
End If
Set objWB = objExcel.ActiveWorkbook
Set objWS = objWB.Sheets(1)
*** Code Here ****
objExcel.Quit
Set objWS = Nothing
Set objWB = Nothing
Set objExcel = Nothing