Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I? Get Excel to do something when I close a workbook

I'm trying to write two seperate macros to make changes to a workbook
when I open it and close it.

When I open the workbook I want to go to fullscreen - which I've
managed to do. However!

When I close the workbook I want to cancel the fullscreen option.

I've tried several things including the WorkBookBeforeClose sub. I can
get Excel to make the changes when I write and run a macro to close the
workbook. But when I use the Close function in the File menu, Excel
stays in fullscreen mode!! Quite frustrating!

Can anyone help??

Many thanks.

Andrew.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default How do I? Get Excel to do something when I close a workbook

Place this events in the Thisworkbook mudule

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayFullScreen = False
End Sub

Private Sub Workbook_Open()
Application.DisplayFullScreen = True
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"emu_tails" wrote in message ...
I'm trying to write two seperate macros to make changes to a workbook
when I open it and close it.

When I open the workbook I want to go to fullscreen - which I've
managed to do. However!

When I close the workbook I want to cancel the fullscreen option.

I've tried several things including the WorkBookBeforeClose sub. I can
get Excel to make the changes when I write and run a macro to close the
workbook. But when I use the Close function in the File menu, Excel
stays in fullscreen mode!! Quite frustrating!

Can anyone help??

Many thanks.

Andrew.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I? Get Excel to do something when I close a workbook

Thanks for the help!!

I've put the VB into the right module. However, if I say try writing a
macro to close the workbook (ThisWorkbook.Close) then the fullscreen
won't change?

Any ideas?



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.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
exiting excel ONLY the workbook will close Brandon Excel Discussion (Misc queries) 12 May 27th 10 09:59 PM
Close Workbook in Excel Brenda from Michigan[_2_] Excel Discussion (Misc queries) 3 February 6th 09 06:32 PM
close workbook without closing excel and stop recursive function chris Excel Discussion (Misc queries) 3 July 10th 06 08:23 PM
Option in Excel to save a close a workbook inactive for 5 minutes Patricia Peterson Excel Discussion (Misc queries) 4 January 5th 06 05:00 PM
Excel shoud not close all active books when clicking close button technomike Excel Discussion (Misc queries) 0 June 10th 05 05:35 PM


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