S
Stalker
Hello, All!
i try the following text from mvps.org
Sub sTestXL()
Dim objXL As Object
Dim strWhat As String, boolXL As Boolean
Dim objActiveWkb As Object
If fIsAppRunning("Excel") Then
Set objXL = GetObject(, "Excel.Application")
boolXL = False
Else
Set objXL = CreateObject("Excel.Application")
boolXL = True
End If
when i adding next code
the excel.exe is not closed after code complete
why?
' objXL.Application.Workbooks.Open "c:\1.xls"
'Set objActiveWkb = objXL.Application.ActiveWorkbook
'With objActiveWkb
'Worksheets("Sheet1").Range("A2").Select
'Worksheets("Sheet1").Range("A2").EntireRow.Insert
' End With
objActiveWkb.Close savechanges:=True
If boolXL Then objXL.Application.QUIT
Set objActiveWkb = Nothing: Set objXL = Nothing
' MsgBox strWhat
End Sub
With best regards, Stalker. E-mail: (e-mail address removed)
i try the following text from mvps.org
Sub sTestXL()
Dim objXL As Object
Dim strWhat As String, boolXL As Boolean
Dim objActiveWkb As Object
If fIsAppRunning("Excel") Then
Set objXL = GetObject(, "Excel.Application")
boolXL = False
Else
Set objXL = CreateObject("Excel.Application")
boolXL = True
End If
when i adding next code
the excel.exe is not closed after code complete
why?
' objXL.Application.Workbooks.Open "c:\1.xls"
'Set objActiveWkb = objXL.Application.ActiveWorkbook
'With objActiveWkb
'Worksheets("Sheet1").Range("A2").Select
'Worksheets("Sheet1").Range("A2").EntireRow.Insert
' End With
objActiveWkb.Close savechanges:=True
If boolXL Then objXL.Application.QUIT
Set objActiveWkb = Nothing: Set objXL = Nothing
' MsgBox strWhat
End Sub
With best regards, Stalker. E-mail: (e-mail address removed)