Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,670
Default How to code macro to close Excel Application?

Does anyone have any suggestions how to code macro to close Excel Application?
I have a macro coding, and would like to add code to close Excel Application
at the end of macro.
Does anyone have any suggestions?
Thanks in advance for any suggestions
Eric
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default How to code macro to close Excel Application?

Hi Eric

Try

Application.DisplayAlerts = False
Application.Quit

--
Jacob


"Eric" wrote:

Does anyone have any suggestions how to code macro to close Excel Application?
I have a macro coding, and would like to add code to close Excel Application
at the end of macro.
Does anyone have any suggestions?
Thanks in advance for any suggestions
Eric

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How to code macro to close Excel Application?

On 7 ene, 11:33, Eric wrote:
Does anyone have any suggestions how to code macro to close Excel Application?
I have a macro coding, and would like to add code to close Excel Application
at the end of macro.
Does anyone have any suggestions?
Thanks in advance for any suggestions
Eric


Hi Eric.

One way is application.quit

Regards,


Benito
Barcelona
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,670
Default How to code macro to close Excel Application?

Thank everyone very much for suggestions
If I close Excel application, will it save this file first before closing?
Does anyone have any suggestions how to edit the code to save the file first
before closing the application?
Thank everyone very much for any suggestions
Eric

"Jacob Skaria" wrote:

Hi Eric

Try

Application.DisplayAlerts = False
Application.Quit

--
Jacob


"Eric" wrote:

Does anyone have any suggestions how to code macro to close Excel Application?
I have a macro coding, and would like to add code to close Excel Application
at the end of macro.
Does anyone have any suggestions?
Thanks in advance for any suggestions
Eric

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How to code macro to close Excel Application?

On 8 ene, 06:09, Eric wrote:
Thank everyone very much for suggestions
If I close Excel application, will it save this file first before closing?
Does anyone have any suggestions how to edit the code to save the file first
before closing the application?
Thank everyone very much for any suggestions
Eric

"Jacob Skaria" wrote:
Hi Eric


Try


Application.DisplayAlerts = False
Application.Quit


--
Jacob


"Eric" wrote:


Does anyone have any suggestions how to code macro to close Excel Application?
I have a macro coding, and would like to add code to close Excel Application
at the end of macro.
Does anyone have any suggestions?
Thanks in advance for any suggestions
Eric


Hi.

If you want to save all the workbooks opened:

Sub quit()
For Each ws In Workbooks
a = ws.Name
ws.Save
Next
Application.quit
End Sub

If you want to save only the active workbook:

Sub quit()
ActiveWorkbook.Save
Application.quit
End Sub

Regards,

Benito
Barcelona
Spain

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
Before Close Event Hide all Worksheets then Close Application RyanH Excel Programming 0 January 24th 08 03:15 PM
execute macro; save it and close using Application.OnTime ina Excel Programming 1 May 12th 06 05:20 PM
Need Macro To Close Excel Application MarySue Excel Programming 3 January 5th 05 07:24 PM
macro to close excel application other than application.quit mary Excel Programming 1 September 14th 04 03:43 PM
unable to close macro using auto_close or application.quit gloria Excel Programming 1 January 14th 04 07:50 AM


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