Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
JHB JHB is offline
external usenet poster
 
Posts: 30
Default Close Excel with a Macro

Sometimes the help files are useful, and sometimes not! In this case
they are not.

I want to shut down not only the spreadsheet but also the Excel
application with a macro. Its one of those things that should be
simple, but somehow I get tangled up with it, since shutting the
spreadsheet down also shuts down the macros, which means that Excel
doesn't get closed!

Suggestions for code would be appreciated by this neophyte!

Regards

John Baker
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Close Excel with a Macro

Look at
Application.Quit
in VBA's help.

But this has never seemed like a very good idea to me.

If I have multiple workbooks open and you quit excel, will you close those
workbooks?

How will you (the author of the code) know if I wanted to save a file, saveas a
new name or just close without saving?

You could have many users ticked off when they run your code.

======
On the other hand, if you're controlling your own instance of excel (from a
different application), and you keep that instance hidden, it seems very
reasonable.



JHB wrote:

Sometimes the help files are useful, and sometimes not! In this case
they are not.

I want to shut down not only the spreadsheet but also the Excel
application with a macro. Its one of those things that should be
simple, but somehow I get tangled up with it, since shutting the
spreadsheet down also shuts down the macros, which means that Excel
doesn't get closed!

Suggestions for code would be appreciated by this neophyte!

Regards

John Baker


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
JHB JHB is offline
external usenet poster
 
Posts: 30
Default Close Excel with a Macro

On Aug 7, 7:48*am, Dave Peterson wrote:
Look at
Application.Quit
in VBA's help.

But this has never seemed like a very good idea to me. *

If I have multiple workbooks open and you quit excel, will you close those
workbooks?

How will you (the author of the code) know if I wanted to save a file, saveas a
new name or just close without saving?

You could have many users ticked off when they run your code.

======
On the other hand, if you're controlling your own instance of excel (from a
different application), and you keep that instance hidden, it seems very
reasonable.



JHB wrote:

Sometimes the help files are useful, and sometimes not! In this case
they are not.


I want to shut down not only the spreadsheet but also the Excel
application with a macro. Its one of those things that should be
simple, but somehow I get tangled up with it, since shutting the
spreadsheet down also shuts down the macros, which means that Excel
doesn't get closed!


Suggestions for code would be appreciated by this neophyte!


Regards


John Baker


--

Dave Peterson


Thanks..just needed a pointer. In fact this is an instance of Excel
that IS opened by an Access application, and I want to get it out of
the way after it executes.

John Baker
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
Macro to close Excel 2007 Ralph Excel Discussion (Misc queries) 2 January 31st 09 08:18 PM
How to close a excel file using Macro coding? Eric Excel Discussion (Misc queries) 1 June 11th 07 08:49 AM
Excel macro to close powerpoint sarahl Excel Discussion (Misc queries) 1 December 2nd 05 01:06 AM
Macro to close excel okanem Excel Discussion (Misc queries) 1 July 19th 05 10:01 AM
macro to close excel Pam C Excel Discussion (Misc queries) 1 May 5th 05 04:43 PM


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