View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Macro to quit application

This doesn't sound like a very nice workbook to me.

I can have multiple workbooks open that you (as a developer) don't know about.
If your workbook tries to close all my workbooks, I could lose data or I could
save data that I didn't want saved.

How will your code handle the other workbooks that are open--will it save them
without asking, then close them? Will it close them without saving?

In either case, I would expect users to come running at you with pitchforks for
the data that got screwed up.

On the other hand if you wanted to close the workbook that has that button, you
could use a line like:

thisworkbook.close savechanges:=true 'or false????

But you still may have the users asking why they lost 2 hours of work or how to
get the original data back that was overwritten.

And the command you may want to use is:

Application.Quit

(don't do it without lots of thought for your co-workers)



K11ngy wrote:

I was told to create command button and call macro quitapplication, record,
ok and the stop recording, Empty Macro?

The it says edit macro by inserting a line ActiveWorkbookClose after the
comments?

I assume this is in VB but I really dont know where in Vb to enter the
above. Tried everything but no success

Help

Steve


--

Dave Peterson