Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
kill command and excel charles Excel Discussion (Misc queries) 7 August 30th 09 04:02 PM
How do I kill the Research pane, other task panes in Excel EllenB Setting up and Configuration of Excel 2 August 9th 06 10:44 PM
How do I make a process map in Excel? The Hard Worker Charts and Charting in Excel 2 May 24th 05 05:38 PM
how to kill excel using a vbscript Harald Staff[_4_] Excel Programming 0 July 17th 03 10:02 PM


All times are GMT +1. The time now is 10:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"