Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 275
Default workbook close macro

Hi,
excuse my naivety but I'm a bit of a novice :)
Very simply I want a macro to close my excel application, but I can only get
it to close the open workbook, here is what I have...

Sub before_close()
Application.ActiveWorkbook.Save
Workbooks("Book1").Close
End Sub

can U help?
than ks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default workbook close macro

Try

Application.Quit

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Anthony" wrote in message
...
Hi,
excuse my naivety but I'm a bit of a novice :)
Very simply I want a macro to close my excel application, but I can only

get
it to close the open workbook, here is what I have...

Sub before_close()
Application.ActiveWorkbook.Save
Workbooks("Book1").Close
End Sub

can U help?
than ks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 275
Default workbook close macro

Thanks Bob!

"Bob Phillips" wrote:

Try

Application.Quit

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Anthony" wrote in message
...
Hi,
excuse my naivety but I'm a bit of a novice :)
Very simply I want a macro to close my excel application, but I can only

get
it to close the open workbook, here is what I have...

Sub before_close()
Application.ActiveWorkbook.Save
Workbooks("Book1").Close
End Sub

can U help?
than ks




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default workbook close macro


Hello Anthony,

Add this to your code...

APPLICATION.QUIT

This will close and exit Excel.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=495387

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 a specific workbook. Dmad11 Excel Discussion (Misc queries) 1 July 7th 09 09:28 PM
run macro on workbook close Nigel Excel Discussion (Misc queries) 3 November 29th 05 08:48 PM
How to close a workbook which contains the macro that's just been run? dead_girl[_2_] Excel Programming 0 October 22nd 04 08:46 AM
How to close a workbook which contains the macro that's just been run? dead_girl Excel Programming 1 October 22nd 04 07:43 AM
Close Workbook from Macro Lou Excel Programming 2 May 18th 04 02:26 AM


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