Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 31
Default Macro to quit application

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Macro to quit application

Insert ActiveWorkbookClose directly under the last apostrophe, before the
first action recorded - this is what is meant by "after the comments."

HTH
Doug Davey

"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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 31
Default Macro to quit application

Thanks Doug

I tried as below, probably me being stupid but didnt work, is it in wrong
place?

Sub quit()

'
' quit Macro
' Macro recorded 06/07/2007 by stephenking
'

'
activeworkbookclose
End Sub


"Doug Davey" wrote:

Insert ActiveWorkbookClose directly under the last apostrophe, before the
first action recorded - this is what is meant by "after the comments."

HTH
Doug Davey

"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

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 140
Default Macro to quit application

Perfect placement in the macro - however the syntax is

ActiveWorkbook.Close

notice the period. Also Case sensitive

HTH

"K11ngy" wrote:

Thanks Doug

I tried as below, probably me being stupid but didnt work, is it in wrong
place?

Sub quit()

'
' quit Macro
' Macro recorded 06/07/2007 by stephenking
'

'
activeworkbookclose
End Sub


"Doug Davey" wrote:

Insert ActiveWorkbookClose directly under the last apostrophe, before the
first action recorded - this is what is meant by "after the comments."

HTH
Doug Davey

"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



  #6   Report Post  
Posted to microsoft.public.excel.misc
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
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Macro to quit application

ps.

Activeworkbook.close

will try to close the workbook that's active--not the workbook with the code.

Thisworkbook.close

will try to close the workbook that owns the code.

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
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 31
Default Macro to quit application

Thanks Steve, that worked perfect

One more thing if you can help please

I want Excel to open at a certain worksheet (Main menu-Splash screen)

Could you help me with where to place code and what code is

Thanks

Steve King

"steve_doc" wrote:

Perfect placement in the macro - however the syntax is

ActiveWorkbook.Close

notice the period. Also Case sensitive

HTH

"K11ngy" wrote:

Thanks Doug

I tried as below, probably me being stupid but didnt work, is it in wrong
place?

Sub quit()

'
' quit Macro
' Macro recorded 06/07/2007 by stephenking
'

'
activeworkbookclose
End Sub


"Doug Davey" wrote:

Insert ActiveWorkbookClose directly under the last apostrophe, before the
first action recorded - this is what is meant by "after the comments."

HTH
Doug Davey

"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

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
quit ie from excel macro Alfie Excel Discussion (Misc queries) 0 April 17th 07 11:52 PM
How to create a macro to open a new application Monika Excel Discussion (Misc queries) 1 January 22nd 07 05:25 PM
Excel application.quit in macro problem TimkenSteve New Users to Excel 3 August 17th 06 06:36 PM
Macro to paste and print in another application punter Excel Discussion (Misc queries) 1 June 17th 06 04:40 PM
Macro to Start an Application Joe Teixeira Excel Discussion (Misc queries) 3 April 26th 06 06:36 PM


All times are GMT +1. The time now is 07:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"