Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default how to kill excel using a vbscript

Hi Sofia

Things like these tend to happen when Excel asks for something or prompts something and no
one responds to the message. See if
XL.Visible = True
-just below "createobject"- will reveal something.

--
HTH. Best wishes Harald
Excel MVP

Followup to newsgroup only please.

"Sofia" wrote in message
...
Hello.

I am running a vb script that essentially runs an Excel
macro. The macro itself does not try to reopen the excel
file. Rather it invokes an .exe which prints a set of
labels. Everytime I run the script, I get a message from
the system (after a few seconds) that the excel is file
is available for editing. I've noticed that even though
the script is setting the Excel object to nothing it
still leaves an instance of Excel running. How do I kill
that instances of Excel (or any other application) within
my vb script?

Here is my vb script:

Dim XL
Dim WB
Set XL = CreateObject("Excel.Application")
Set WB = XL.Workbooks.Open("C:\2dseismiclabels.xls")
msgbox("about to print labels")
xl.Run "Macro1"
msgbox("finished printing labels")
wb.save
WB.Close
XL.Quit
Set WB = Nothing
Set XL = Nothing



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
Run VBScript from Excel Amy M Excel Discussion (Misc queries) 4 September 19th 08 09:07 PM
Writing Macros In VBScript Alex Turner Excel Discussion (Misc queries) 0 January 10th 08 01:07 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


All times are GMT +1. The time now is 10:21 PM.

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"