ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Saving the Workbook (https://www.excelbanter.com/excel-programming/423286-re-saving-workbook.html)

eggpap[_18_]

Saving the Workbook
 

Ariel Dugan;208753 Wrote:
Hi,

Its actually application.displayalerts that I was thinking of.

I would suggest that you alter the SaveAndExit sub as follows. I
tested it
this way and it works. Note, you may need to move the functionality
from
your Before_Close event into a regular module, and call it from both
the
SaveAndExit and from the Before_Close event.

Sub SaveAndExit()
Application.DisplayAlerts = False

''Call your other functionality that you want exectued before
saving...

ThisWorkbook.Save
ThisWorkbook.Close
End Sub



I've registered the following behaviour:
by the SaveAndExit menu command the alert is no more displayed, but the
wb don't closes (i.e. the Excel window don't closes). Moreover this
action corrupts some cell format (from numeric to date) (see picture
attached).

By the Excel window CloseButton nothing of this happens.

Thanks, Emiliano


+-------------------------------------------------------------------+
|Filename: FormatCorrupt.jpg |
|Download: http://www.thecodecage.com/forumz/attachment.php?attachmentid=70|
+-------------------------------------------------------------------+

--
eggpap

Excel 2003 on Vista HP System - can use VBA
------------------------------------------------------------------------
eggpap's Profile: http://www.thecodecage.com/forumz/member.php?userid=90
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=57272



All times are GMT +1. The time now is 11:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com