R
RzB
There appear to be a million post on this subject....
I have read most of them , however dimbo that I am
I just don't see what I'm doing wrong. Have I got "implicit"
references in the code below?
My problem is that after I run the code below, Excel is open
in the Task Manager.
I have reduced my code to the following snippet... Why oh
why don't it just close when I tell it too.... And - even more
to the point - if I tell it to close and it don't, why do I not get
an error! Hmmm - as you can see I'm getting frustrated and
beginning to loose it
Any help would be most appreciated...
Using XP Prof SP1, Access 2002 SP3, Excel 2002 SP3.
Roy
========================================
Private m_objXlApp As Excel.Application
Private m_objXlWkb As Excel.Workbook
Private m_objXlSht As Excel.Worksheet
Private Sub TestButton_Click()
'create and open
Set m_objXlApp = New Excel.Application
m_objXlApp.SheetsInNewWorkbook = 1
Set m_objXlWkb = m_objXlApp.Workbooks.Add
Set m_objXlSht = m_objXlWkb.Worksheets("Sheet1")
'save it
m_objXlWkb.SaveAs ("c:\AAA.xls")
'Close it
Set m_objXlSht = Nothing
m_objXlWkb.Close
Set m_objXlWkb = Nothing
m_objXlApp.Quit
Set m_objXlApp = Nothing
End Sub
I have read most of them , however dimbo that I am
I just don't see what I'm doing wrong. Have I got "implicit"
references in the code below?
My problem is that after I run the code below, Excel is open
in the Task Manager.
I have reduced my code to the following snippet... Why oh
why don't it just close when I tell it too.... And - even more
to the point - if I tell it to close and it don't, why do I not get
an error! Hmmm - as you can see I'm getting frustrated and
beginning to loose it
Any help would be most appreciated...
Using XP Prof SP1, Access 2002 SP3, Excel 2002 SP3.
Roy
========================================
Private m_objXlApp As Excel.Application
Private m_objXlWkb As Excel.Workbook
Private m_objXlSht As Excel.Worksheet
Private Sub TestButton_Click()
'create and open
Set m_objXlApp = New Excel.Application
m_objXlApp.SheetsInNewWorkbook = 1
Set m_objXlWkb = m_objXlApp.Workbooks.Add
Set m_objXlSht = m_objXlWkb.Worksheets("Sheet1")
'save it
m_objXlWkb.SaveAs ("c:\AAA.xls")
'Close it
Set m_objXlSht = Nothing
m_objXlWkb.Close
Set m_objXlWkb = Nothing
m_objXlApp.Quit
Set m_objXlApp = Nothing
End Sub