-
I need help with a windows problem. After creating an excel object and closing it I still see an instance of Eccel in the running task window. However I am unable to see it or close it. I have tried using the postmessage, closewindow,and destroywindow method with no results. Any help will be much appreciated.
-
<?>
Being as one can't see your code, try this code and see if you get the same problem. On my system, when I quit I quit.
You need an excel file called myExcel.xls with a macro inside of it call Marco1.
Code:
Private Sub Command1_Click()
'put this code inside the form load event of the Application
'change the file name and macro name to reflect your file and macro
'this will open Excel and run the macro
'
'create and object (Excel SpreadSheet)
Dim oXL As Object
Set oXL = CreateObject("Excel.Application")
' Open the workbook that contains the macro to run.
oXL.Workbooks.open "C:\My Documents\myExcel.xls"
'
'as object opens invisible, make visible if needed, if not omit
'the line oXL.visible=true
'
oXL.Visible = True
'
' Run the macro.
oXL.Application.Run "myExcel.xls!Macro1"
'
' Quit Microsoft Excel.
oXL.Quit
'
' Free the object from memory.
Set oXL = Nothing
End Sub