LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default help!kill process excel.exe

Hi,

If you are running this function from within Excel, there is no need of
using CreateObject. Instead use Workbooks.open(FileName)

If you want to avoid this book getting focus on open put the followoing
line above the open method:

Application.ScreenUpdating=false

Pramathesh


xz739 wrote:
i have created a excel workbook in vb,below are the codes:

private sub report ()
Dim sfilename As String
Dim spath As String
Dim dtecurrent As Date
Dim msexcel As Object
dtecurrent = Now
Set msexcel = CreateObject("Excel.Application")

With msexcel
.Visible = False
.Workbooks.Open "d:\DYNAMICS\PDB\RPT.xls", , False
End With

With msexcel.Application
.ActiveWorkbook.ActiveSheet.Select
.Cells(2, 1) = Time
.Cells(2, 2) = Date
End With
sfilename = Format(dtecurrent, "mmddyyyy HHMMSS") & ".xls"

spath = System.BasePath & "\htrdata\" & sfilename

msexcel.ActiveWorkbook.SaveAs spath 'Saves the file with the path

msexcel.Visible = True

Set msexcel = Nothing
end sub
*********
in the program i call the function period,because the excel run in
background,so the problem is every time it will add a windows process,
how can i close the process in the function?


--
xz739
------------------------------------------------------------------------
xz739's Profile: http://www.excelforum.com/member.php...o&userid=37053
View this thread: http://www.excelforum.com/showthread...hreadid=567780


 
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 Excel Process Mike Moore[_2_] Excel Programming 5 March 17th 05 08:55 AM
How to Kill Excel application process HoGo Excel Programming 2 December 13th 04 10:53 AM
Quit Method do not kill excel process Rui Oliveira Excel Programming 2 January 16th 04 09:38 AM
Quit Method do not kill excel process Rui Oliveira Excel Programming 0 January 15th 04 04:51 PM
to kill a excel process han keat Excel Programming 1 July 18th 03 07:32 AM


All times are GMT +1. The time now is 04:33 PM.

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

About Us

"It's about Microsoft Excel"