Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default close workbook without saving or promt to save

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default close workbook without saving or promt to save

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default close workbook without saving or promt to save

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default close workbook without saving or promt to save

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
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
close without saving calebjill Excel Discussion (Misc queries) 1 January 30th 09 12:16 AM
close w/o saving jatman Excel Worksheet Functions 5 February 29th 08 03:52 PM
VBA - Close without saving changes PaulW Excel Discussion (Misc queries) 2 July 27th 06 02:22 PM
Option in Excel to save a close a workbook inactive for 5 minutes Patricia Peterson Excel Discussion (Misc queries) 4 January 5th 06 06:00 PM
Excel 2003: File->Close without saving changes (save menu does no. Wai-Yee Excel Discussion (Misc queries) 5 July 26th 05 12:49 AM


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