After I close all workbooks, quit application and set all objects to nothing; -Excel app is still running. What else can I do to terminate application??????????
heres an example of what i am doing, and i have the same problem . Note also, that during the xlMacro, i am saving the workbook to a folder - perhaps this is the cause ?:
Function Make_Report(rLandcode as string, rFileName As string)
Dim xl As Excel.Application
Set xl = New Excel.Application
xl.Visible = True
xl.Workbooks.Add
With xl ' VBA Macro
''''''''
''''''''
End With
xl.ActiveWorkbook.Close
xl.Application.Quit
Set xl = Nothing
End Function
Dim ExcelApp As Excel.Application
Dim ExcelCht As Excel.Chart
Dim ExcelSht As Excel.Worksheet
Dim ExcelWkb As Excel.Workbook
Dim MyExcel As Boolean
Private Sub Command1_Click()
On Error Resume Next
Err.Clear
Set ExcelApp = GetObject(, "Excel.Application"
If Err.Number <> 0 Then
Err.Clear
Set ExcelApp = CreateObject("Excel.Application"
If Err.Number <> 0 Then
MsgBox "Error: " & Err.Description
Else
MyExcel = True
End If
Else
MyExcel = False
End If
ExcelApp.Visible = True
Check1.Value = vbChecked
Command2.SetFocus
End Sub
Private Sub Command10_Click()
Unload Me
End Sub
Private Sub Command2_Click()
Set ExcelWkb = ExcelApp.Workbooks.Add
Set ExcelSht = ExcelWkb.Worksheets(1)
Check2.Value = vbChecked
Command3.SetFocus
End Sub
Private Sub Command3_Click()
Dim i As Integer
Dim j As Integer
For i = 1 To 4
For j = 1 To 10
ExcelSht.Cells(j, i) = Rnd() * 100
Next j
Next i
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.