Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Is it possible to exit Excel completely from a macro?

I'm trying to run a auto open macro that will open a second workbook, save
data there and then shut down Excel completely. Is this possible?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 125
Default Is it possible to exit Excel completely from a macro?

Application.quit

if you want to save stuff first
For Each w In Application.Workbooks
w.Save
Next w
Application.Quit

--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"salt417" wrote:

I'm trying to run a auto open macro that will open a second workbook, save
data there and then shut down Excel completely. Is this possible?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Is it possible to exit Excel completely from a macro?


Not sure what you mean by "save data there", but this code will Open a
new workbook... save it to a directory... then close all open workbooks
and exit Excel.


Sub Test()

Dim wrk As Workbook

Set wrk = Workbooks.Add
wrk.SaveAs "C:\Blah\Blah.xls"
Application.Workbooks.Close
Application.Quit

End Sub


On Dec 15, 2:27 pm, salt417 wrote:
I'm trying to run a auto open macro that will open a second workbook, save
data there and then shut down Excel completely. Is this possible?


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
Completely Exit Excel Macro Rob Excel Discussion (Misc queries) 3 July 13th 07 12:56 PM
deleting a macro completely sgreene Excel Discussion (Misc queries) 2 October 19th 06 05:37 PM
macro wants to exit excel curlydave Excel Discussion (Misc queries) 3 July 2nd 06 04:19 PM
Write macro don't ask to save when exit excel Rui Alvares Excel Programming 0 March 29th 06 12:50 AM
How do i create a command button or macro to exit Microsoft Excel raj Excel Worksheet Functions 1 April 30th 05 02:17 PM


All times are GMT +1. The time now is 12:26 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"