View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] WATYF1@gmail.com is offline
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?