Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default unable to close macro using auto_close or application.quit

I have a macro that is processed using sub auto via a
hyperlink. Basically, if someone cick the hyperlink it
will run the macro. All the processing is invisible. Now,
when this marco is run by just clicking the excel
application it will run invisible and end he application
invisible. However, when this marco is processed using
the hyperlink, it will process invisible, but at the end
it will show the sheet that i use to create the marco. I
have used application.quit or auto_close, however, they
rerun the process again and again. I am not able to use
any of the close statment to shut of the application one
the macro ends. Basically, i do not want the user to see
the excel application. thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default unable to close macro using auto_close or application.quit

Hi Gloria,

I
have used application.quit or auto_close, however, they
rerun the process again and again. I am not able to use
any of the close statment to shut of the application one
the macro ends. Basically, i do not want the user to see
the excel application. thanks in advance


When your macro has finished its work, add
Application.Quit as the last statement in the routine that is last
executed before the macro reaches its end.

You must make sure that all open workbooks are saved or closed (except
the one with the macro) without saving before this will work though.

To tell excel a workbook does not have to be saved when closing, use:

Workbooks("Yourbooksname.xls").Close SaveChanges:=False

Or alternatively set:

Workbooks("Yourbooksname.xls").Saved=True

This will tell Excel to forget whether any change has been made to a
workbook and it will close it without prompting for a save when you
quit Excel.

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com

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 quit application K11ngy Excel Discussion (Misc queries) 7 July 6th 07 04:48 PM
Excel application.quit in macro problem TimkenSteve New Users to Excel 3 August 17th 06 06:36 PM
macro to close excel application other than application.quit mary Excel Programming 1 September 14th 04 03:43 PM
Macro to quit excel and go back to original application wendy Excel Programming 0 January 9th 04 08:22 PM
Using Application.quit is causing my macro to run and print twice... Kathy[_4_] Excel Programming 0 July 31st 03 07:12 PM


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