Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
to kill a excel process
Hi all, I want to sent parse the email header and send the info to excel
worksheet. I do this by writing a macro in Outlook to create a excel object. However, I have problem killing the excel process, everytime after I run the macro I have to manually go to task manager to end the process. Could anyone please help me? Thank you!! =) Function array_to_excel() Dim objApp As Application Dim objDL As Object Dim objExcel As Excel.Application Dim objWB As Excel.Workbook Dim objWS As Excel.Worksheet Dim objRange As Excel.Range Dim file_name As String file_name = "E:\excel\email.xls" Set objExcel = new Excel.Application objExcel.Visible = True Set objWB = objExcel.Workbooks.Open(FileName:=file_name) Set objWS= objWB.Worksheets(1) 'do something objWB.Save objExcel.DisplayAlerts = False objWS.SaveAs FileName:=file_name, FileFormat:= _ xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False objWB.Close objExcel.DisplayAlerts = True objExcel.Quit Set objWS = Nothing Set objWB = Nothing Set objExcel = Nothing End Function *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
to kill a excel process
Usually the instance of Excel only remains when there's a
connection of some kind still open. I see you had a Range dim's, make sure that it's set to nothing too. Patrick Molloy Microsoft Excel MVP -----Original Message----- Hi all, I want to sent parse the email header and send the info to excel worksheet. I do this by writing a macro in Outlook to create a excel object. However, I have problem killing the excel process, everytime after I run the macro I have to manually go to task manager to end the process. Could anyone please help me? Thank you!! =) Function array_to_excel() Dim objApp As Application Dim objDL As Object Dim objExcel As Excel.Application Dim objWB As Excel.Workbook Dim objWS As Excel.Worksheet Dim objRange As Excel.Range Dim file_name As String file_name = "E:\excel\email.xls" Set objExcel = new Excel.Application objExcel.Visible = True Set objWB = objExcel.Workbooks.Open(FileName:=file_name) Set objWS= objWB.Worksheets(1) 'do something objWB.Save objExcel.DisplayAlerts = False objWS.SaveAs FileName:=file_name, FileFormat:= _ xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False objWB.Close objExcel.DisplayAlerts = True objExcel.Quit Set objWS = Nothing Set objWB = Nothing Set objExcel = Nothing End Function *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
kill command and excel | Excel Discussion (Misc queries) | |||
How do I kill the Research pane, other task panes in Excel | Setting up and Configuration of Excel | |||
How do I make a process map in Excel? | Charts and Charting in Excel | |||
how to kill excel using a vbscript | Excel Programming |