LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Closing a workbook...

I've written some code in the Workbook_BeforeClose( ) routine. It basically
clears and resets values in a spreadsheet before closing and the last line
of the subroutine is a Workbook.Save command (or something like that) and it
saves the changes without prompting me if I want to save them.

Up until now it's working perfectly but I've been using the 'x' from the
upper right hand corner of the window. Now I'm trying to create a custom
menu with an Exit command to use that to close the workbook in place of the
Close window command, 'x'.

I've coded the routine as follows:

Sub mcrShutDown ( )

ThisWorkbook.Saved = True
Application.Workbook.Close

End Sub

There are 2 problems: 1) I'm getting prompted to save changes and 2) it's
not running the Workbook_BeforeClose routine so my program doesn't get
reset.

What am I missing? How come the Workbook_BeforeClose routine isn't running?

Jeff


 
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
Help with closing down a workbook?? Don Excel Worksheet Functions 1 May 9th 05 04:05 AM
Closing workbook Ed Excel Programming 4 February 6th 04 03:41 PM
closing excel after closing a workbook CWalsh[_2_] Excel Programming 3 January 21st 04 03:33 PM
Closing a workbook Belinda Excel Programming 2 January 15th 04 01:27 PM
closing workbook Sam Dickins Excel Programming 1 November 27th 03 03:43 PM


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