Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
i am new to excel 2007 and when closing the only visible sheet in my workbook
i need it to close the workbook without offering option to save. i have tried to use macros but i dont think im doing it correctly. i have a active button that works but i would like it to work when you close from the top right x or exit excel button. shane |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
In Thisworkbook module of your workbook.
Private Sub Workbook_BeforeClose(Cancel As Boolean) ThisWorkbook.Saved = True End Sub Note you have to save at least once before closing first time or you will lose the code your just pasted into the module. Gord Dibben MS Excel MVP On Wed, 3 Feb 2010 17:57:01 -0800, ATVNSHANE wrote: i am new to excel 2007 and when closing the only visible sheet in my workbook i need it to close the workbook without offering option to save. i have tried to use macros but i dont think im doing it correctly. i have a active button that works but i would like it to work when you close from the top right x or exit excel button. shane |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
i used alt f11 and add module, enter code. exit back to worksheet and saved
then close. when i went back in it still promt to save when closing. is that the correct place to enter code? "Gord Dibben" wrote: In Thisworkbook module of your workbook. Private Sub Workbook_BeforeClose(Cancel As Boolean) ThisWorkbook.Saved = True End Sub Note you have to save at least once before closing first time or you will lose the code your just pasted into the module. Gord Dibben MS Excel MVP On Wed, 3 Feb 2010 17:57:01 -0800, ATVNSHANE wrote: i am new to excel 2007 and when closing the only visible sheet in my workbook i need it to close the workbook without offering option to save. i have tried to use macros but i dont think im doing it correctly. i have a active button that works but i would like it to work when you close from the top right x or exit excel button. shane . |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you for your time, i just got it figured out.
"Gord Dibben" wrote: In Thisworkbook module of your workbook. Private Sub Workbook_BeforeClose(Cancel As Boolean) ThisWorkbook.Saved = True End Sub Note you have to save at least once before closing first time or you will lose the code your just pasted into the module. Gord Dibben MS Excel MVP On Wed, 3 Feb 2010 17:57:01 -0800, ATVNSHANE wrote: i am new to excel 2007 and when closing the only visible sheet in my workbook i need it to close the workbook without offering option to save. i have tried to use macros but i dont think im doing it correctly. i have a active button that works but i would like it to work when you close from the top right x or exit excel button. shane . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
close without saving | Excel Discussion (Misc queries) | |||
close w/o saving | Excel Worksheet Functions | |||
VBA - Close without saving changes | Excel Discussion (Misc queries) | |||
Option in Excel to save a close a workbook inactive for 5 minutes | Excel Discussion (Misc queries) | |||
Excel 2003: File->Close without saving changes (save menu does no. | Excel Discussion (Misc queries) |