Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro Code for closing excel...


Hi there, i've made an Exit button. I want it to exit excel when
clicked, but all i managed to do is close the workbook. Is there any
way at all to close Excel? or is the furthest it goes is closing a
workbook?


--
Bonbon
------------------------------------------------------------------------
Bonbon's Profile: http://www.excelforum.com/member.php...o&userid=31866
View this thread: http://www.excelforum.com/showthread...hreadid=532192

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default Macro Code for closing excel...

For Each w In Application.Workbooks
w.Save
Next w
Application.Quit

I think that does it, havent tested it yet though!,, might be better to
do the save first and then time delay the quit as it will be real slow
on a big workbook

HTH

Duncan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro Code for closing excel...


Duncan Wrote:
For Each w In Application.Workbooks
w.Save
Next w
Application.Quit

I think that does it, havent tested it yet though!,, might be better
to
do the save first and then time delay the quit as it will be real slow
on a big workbook

HTH

Duncan


Hi thanks for both the replies! But Duncan i dont understand the 'w' is
it workbook or something?


--
Bonbon
------------------------------------------------------------------------
Bonbon's Profile: http://www.excelforum.com/member.php...o&userid=31866
View this thread: http://www.excelforum.com/showthread...hreadid=532192

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default Macro Code for closing excel...

Yep, exactly right, its just to save each workbook open or else it will
pop up and say "do you want to save"

Duncan

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro Code for closing excel...


Ah thank you, it worked great! :)


--
Bonbon
------------------------------------------------------------------------
Bonbon's Profile: http://www.excelforum.com/member.php...o&userid=31866
View this thread: http://www.excelforum.com/showthread...hreadid=532192



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Macro Code for closing excel...

Hi Bonbon

use Application.Quit method to close excel

Thanks
Xcelion

"Bonbon" wrote:


Hi there, i've made an Exit button. I want it to exit excel when
clicked, but all i managed to do is close the workbook. Is there any
way at all to close Excel? or is the furthest it goes is closing a
workbook?


--
Bonbon
------------------------------------------------------------------------
Bonbon's Profile: http://www.excelforum.com/member.php...o&userid=31866
View this thread: http://www.excelforum.com/showthread...hreadid=532192


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
How to code on Macro on saving and closing a file? Eric Excel Worksheet Functions 1 June 10th 07 01:32 PM
Problems closing Excel correctly by code Filips Benoit Excel Programming 2 June 29th 05 01:37 PM
Closing excel with a macro TJexcel Excel Programming 1 December 8th 04 07:42 AM
Closing Excel down with a macro? andycharger[_28_] Excel Programming 2 May 6th 04 04:18 PM
Excel code to Wait until Word finishes printing before closing Mike Molyneaux[_2_] Excel Programming 2 October 24th 03 02:45 AM


All times are GMT +1. The time now is 09:23 AM.

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"