cassidybklyn
Programmer
I am trying to quit excel after processing. Below is what I am doing:
dim xlApp As Object
dim xlWb As Object
dim xlWksht As Object
Set xlApp = CreateObject("Excel.Application")
Set xlWb = xlApp.Workbooks.Add
Set xlWksht = xlWb.Worksheets("Sheet1")
process - process- process
"" "" ""
Set xlApp = Nothing
Set xlWb = Nothing
Set xlWksht = Nothing
xlApp.Quit <====================
xlApp.Application.Quit <========
Any of the last two lines of codes: "xlApp.Quit" or "xlAppl.Application.Quit" gives me Runtime error "91" (Object variable or With block variable not set)
How can I fix this?
Thanks.
C.
dim xlApp As Object
dim xlWb As Object
dim xlWksht As Object
Set xlApp = CreateObject("Excel.Application")
Set xlWb = xlApp.Workbooks.Add
Set xlWksht = xlWb.Worksheets("Sheet1")
process - process- process
"" "" ""
Set xlApp = Nothing
Set xlWb = Nothing
Set xlWksht = Nothing
xlApp.Quit <====================
xlApp.Application.Quit <========
Any of the last two lines of codes: "xlApp.Quit" or "xlAppl.Application.Quit" gives me Runtime error "91" (Object variable or With block variable not set)
How can I fix this?
Thanks.
C.