M
MrBoom
I'm in the process of writing an Access application that performs some
Excel automation. I've been having problems with the Excel process
continuing to run upon script termination and error 462 problems. I
gather both are associated with making implicit references rather than
explicit references to objects. I've read much about making explicit
references in my automation script both on here and in the MSKB.
I was pretty sure I'd got all my references correct, but Excel still
wasn't closing. Just to test it, I created a new script that simply
opens the references then closes them again. Guess what, it suffers
with the same problem. I've pasted the script below, can anyone else
see what's wrong with it because I can't!!
Thanks.
Private Sub Form_Load()
Dim appExcel As Excel.Application ' I've also tried "as Object"
here
Dim wbExcel As Excel.Workbook
Dim wsExcel As Excel.Worksheet
Set appExcel = Excel.Application
Set wbExcel = appExcel.Workbooks.Add
Set wsExcel = wbExcel.Sheets(1)
Set wsExcel = Nothing
wbExcel.Close SaveChanges:=True
Set wbExcel = Nothing
appExcel.Quit
Set appExcel = Nothing
End Sub
Excel automation. I've been having problems with the Excel process
continuing to run upon script termination and error 462 problems. I
gather both are associated with making implicit references rather than
explicit references to objects. I've read much about making explicit
references in my automation script both on here and in the MSKB.
I was pretty sure I'd got all my references correct, but Excel still
wasn't closing. Just to test it, I created a new script that simply
opens the references then closes them again. Guess what, it suffers
with the same problem. I've pasted the script below, can anyone else
see what's wrong with it because I can't!!
Thanks.
Private Sub Form_Load()
Dim appExcel As Excel.Application ' I've also tried "as Object"
here
Dim wbExcel As Excel.Workbook
Dim wsExcel As Excel.Worksheet
Set appExcel = Excel.Application
Set wbExcel = appExcel.Workbooks.Add
Set wsExcel = wbExcel.Sheets(1)
Set wsExcel = Nothing
wbExcel.Close SaveChanges:=True
Set wbExcel = Nothing
appExcel.Quit
Set appExcel = Nothing
End Sub