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
0
Utf
2/4/2010 1:57:01 AM
excel.misc 78881 articles. 5 followers. Follow

3 Replies
2993 Views

Similar Articles

[PageSpeed] 13

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
<ATVNSHANE@discussions.microsoft.com> 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

0
Gord
2/4/2010 4:34:00 AM
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
> <ATVNSHANE@discussions.microsoft.com> 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
> 
> .
> 
0
Utf
2/4/2010 3:44:02 PM
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
> <ATVNSHANE@discussions.microsoft.com> 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
> 
> .
> 
0
Utf
2/4/2010 3:57:02 PM
Reply:

Similar Artilces:

OL2007, messages don't always close after sending
Let's say I've just finished a spreadsheet and I want to send it to someone. I'll click the big Office button and choose Send -> Email, and up pops a new email message with my spreadsheet attached. All fine so far until I click the Send button (or Alt-S, or Ctrl-Enter, doesn't matter which). The message appears in the Outbox and Outlook will send it, but it also stays open in front of Excel until I click the Close button. I can still make further edits to my workbook, but the email message is in the way and I can't see what I'm doing, until I manually close...

saving slides as png/jpeg @ 1280x800
I have created a presentation with screen size 1280x800. When I save individual files as png or jpeg, they are saved as 960x600, which is a different size. Is there a way to export individual slides at 1280x800? On 30 Apr, 17:01, Alessandra <acima...@gmail.com> wrote: > I have created a presentation with screen size 1280x800. When I save > individual files as png or jpeg, they are saved as 960x600, which is a > different size. =A0Is there a way to export individual slides at > 1280x800? I forgot to say I am using PowerPoint 2007. I use an add-in to do this (ove...

Outlook 2007 send group emails without disclosure of recipient details
i got an email, i cannot see the recipient details. when look into the email header, it seems come from X-Mailer: Microsoft Office Outlook, Build 11.0.5510 Can i do it at Outlook 2007? Thanks a lot. Tony Sure, you can do it in any email clients if you put the senders in the BCC field. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://www.slipstick.com/outlook/ol2007/ Outlook Tips by email: dailytips-subscribe-request@lists.outlooktips.net Outlook Tips: http://ww...

100% cpu utilization during save as
I'm wondering if anyone here can help me with this. When I'm typing a filename in the Save As dialog box in Excel 2003, excel.exe shoots up to 100% CPU utilization and it takes a second or two for the letters I've typed to show up. This only happens when I'm trying to save to a network location. The same issue comes up in Word 2003 and Powerpoint 2003, but not in any other windows applications. Any ideas? Thanks --Cam If this is only to a network location, it suggests a problem on the network side - or permissions. But are you using mapped drives for this? If so, try ...

Word always asks to save changes to the template
For my work we have made templates for different letters we have to send. Our application (VB6) calls those templates when we want to send a letter. Using the code we follow a few steps : - open word - open a new document using our template - save the document (.doc) on a server - sometimes print the document - sometimes immediately close the document (when we don't want users to modify the document afterwards) When they closed the document the users always get 2 questions : - save changes to template for the letter - save changes to normal.dot I already found a solution to avoid the q...

How do I look at two worksheets in one Excel workbook at same time
I know how to arrange windows to look at multiple workbooks. But I want to have two worksheets displayed at the same time from the same workbook. Is there a way to do that? Window - New Window this will create a second view of active workbook. Then you can do Window - Arrange, active workbook only. -- Best Regards, Luke M "PeoriaJean" <PeoriaJean@discussions.microsoft.com> wrote in message news:503A1BB9-2130-4346-A0AF-A461388397B2@microsoft.com... >I know how to arrange windows to look at multiple workbooks. But I want to > have two worksheets di...

Outlook 2003 fails to terminate when closed
MS Outlook continues running as a process when terminated (as shown by Task Manager); it disappears from the Applications tab but remains under the Processes tab. If Outlook is reloaded, two copies appear under Processes (albeit the second with only small memory usage) but nothing under Applications. If the two copies are killed (End Process in Task Manager) and Outlook is then reloaded again, I'm informed that Outlook failed to load properly and do I want it loading in Safe Mode now. Outlook loads successfully in either mode, but still leaves a copy of itself behind under Processe...

Saving Word E-Mail as a Revision/Draft
Hi, I would like to be able to use the E-Mail feature in Word 2003 to save an email as a draft/revision for future use. I do not want to save the word doc as an attachment. Is this possible? Thanks, Josh Why don;t you just create the word doc, save it, and then email it when you're ready. -- JoAnn Paules MVP Microsoft [Publisher] Tech Editor for "Microsoft Publisher 2007 For Dummies" "JoshB" <JoshB@discussions.microsoft.com> wrote in message news:9710F08D-64E2-45B7-8115-BE8F0B116369@microsoft.com... > Hi, > I would like to be...

Close opportunity #2
Hello everybody, I know I have no posibility to customise the "opportunityclose" -entity but I need to change some attributes. In my example I like to change the statuscode values. Thanks for your help You need to customize opportunity entity, statuscode attribute (Status Reason) "Gerd Gottschall" <GerdGottschall@discussions.microsoft.com> wrote in message news:73847649-7E5F-443C-9600-BCC2089E3B24@microsoft.com... > Hello everybody, I know I have no posibility to customise the > "opportunityclose" -entity but I need to change some attributes....

how to use a saved master page
I have created a new master page and saved it as a .pub file. The question is when opening a new document, how do I apply the saved master file? Open the master file, copy, paste to your new publication. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Colin" <Colin @discussions.microsoft.com> wrote in message news:A3C59647-7D56-46B9-AA56-C707538ECDED@microsoft.com... >I have created a new master page and saved it as a .pub file. The question > is when opening a new document, how do I apply the saved mas...

Thrift Savings Plan #2
Does anyone know an accurate way of tracking the military retirement plan, TSP? I have just added an account called TSP and modeled it like a 401(k). Then for each of the funds you have, just add a new investment. You won't have a stock symbol or anything. Some days, I manually update the fund prices, and others I don't. It will calculate your returns whenever you make new transactions. I basically just make those investment transactions whenever I get my quarterly statement. I don't know of a better way of tracking the TSP. "Anthony" wrote: > Does anyone ...

Setting email so server will not save emails on server
I have two computers. ( Desktop & laptop) I seldom use the laptop but when I do use it and get my emails it brings up every email that I have already read and deleted from desktop. Is there a setting where I can set so the server will not keep the deleted emails? On both machines: Tools | Accounts | Mail | Properties | Advanced - Check: Leave a copy of messages on the server. On one machine only, (The desktop would be logical for you), check to Delete messages after X days to satisfy your allotted space you get from your server, and Remove from server when d...

Workbook there but not visible! Help!
I was working on some VBA code for an excel application I am writing. I switched between the VBE and the spreadsheet and all of a sudden my workbook is no longer visible! In the VBE project explorer window it shows my project and my code but in the excel window...no workbook! Nothing! Ran a test procedure calling IsAddin to see if somehow I accidentally clicked a button/box telling Excel to make this file an addin but it returned false. I did close the file and re-open it. Any ideas? Maybe it's just off the visible screen: Window|Arrange|tiled (and resize manually) or maybe y...

Can I remove blanks from a range without using sort?
I have a range of cells A1:a10, say, which obtain data from another source. Some of those cells a3, a6:a8, say, under certain conditions, will be blank. How do I reorder this range such that the cells containing information are listed together, removing the blanks? I want to do this using a formula, rather than filter or sort, as the data, and hence the blank cells, will change, and I want to perform analysis on the cells containing data. this is from one of the newsgroup correspondents use this code statement Range("a1:a10").SpecialCells(xlCellTypeBlanks).EntireRow.Del...

"The underlying connection was closed" Error
Hi!, I'm using WebRequest to post a URL. But, sometimes, this tell me the error "The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.". I don't know why!!. This worked perfect in .NET 1.1, but in .NET 2.0, I has this behavior. Thanks! ...

how to save settings for printing several envelopes
I want to print addresses on several envelopes which are the same size but the addresses are different (for Christmas cards). Is there a way to do this without going to options each time and reset the size and font that I want? Create an envelope template. You can start from scratch with a new document, selecting the desired paper size (or specifying a custom size) or use Add to Document to add your envelope to the current document. Then see http://sbarnhill.mvps.org/WordFAQs/DetachEnvelope.htm for instructions on separating the envelope from the document. Once you have just the ...

Why Excel 2007 not responding after saving
I have reinstalled Excel 2007 (Office Home & Student) but it is worse. Now having problems even opening files. If I click on a cell it pauses for ages and then says it is not responding. Try looking for help here: http://support.microsoft.com/?scid=ph;en-gb;8753#tab3 "Xandersmum" wrote: > I have reinstalled Excel 2007 (Office Home & Student) but it is worse. Now > having problems even opening files. If I click on a cell it pauses for ages > and then says it is not responding. ...

Error 1004 Workbooks.Add Inplace-Activation
Hi ! I don't know if I am in the correct forum but here it comes any way Sub AddWorkBook() ThisWorkbook.Application.Workbooks.Add End Sub this simple macro only works from the debugger environment if I have XL Inplace Activated Is there any workarounds ? Best regards Magnus Is it so that XL has a state that it cannot do this ? COleClientItem::activeUIState Do I have to change state to pItem->DoVerb (OLEIVERB_OPEN, pView ); ???? "Magnus Pettersson" <magnus@businessvision.se> wrote in message news:uRngzLSvEHA.536@TK2MSFTNGP11.phx.gbl... > Hi ! > I d...

Can a workbook be used as a function
Hi, I have an excel workbook (A) that givern three parameters, temp1, temp and flow calculates the energy transfer for a process we conduct, have another workbook (B) which contains the hourly logged data for th process from which we generate monthly reports. Is it possible to use workbook (A) like a function and pass to it th three parameters from workbook (B) and return to workbook (B) th answer ie. energy transfered. Workbook (B) contain approx 750 logs so i need to repeat th calculation 750 times I could link the two which works for the first piece of logged data bu how to automatically...

Embedding a single workbook in a word doc
I prepare memos and I insert a bunch of tables out of a single excel file with a bunch of interlinked sheets. I typically insert them as pictures or linked pictures; however we often email the memo around for comments and and it gets complicated to have multiple versions and keep the links current. The other option is to insert the tables as embedded objects; however, if I do that, each table becomes a separate excel file, so I can=92t make changes to one and have it reflected in the tables throughout the document. Is there any way to create a single embedded workbook which I use several ti...

Excel 2007 slow saving with defined names
Hello, I am using a worksheet with a lot of defined names. Saving this sheet in Excel 2007 takes about 5 minutes! In previous Excel-versions the same worksheet saves within 10 seconds. Does anyone have an idea to improve this performance? Probably Windows Vista has something to do with this problem, because: - Windows XP and Excel 2007: fast saving - Windows Vista and Excel 2003: fast saving - Windows Vista and Excel 2007: slooooow saving Any ideas? Greeting RI ...

Names of Sheets in workbook
Hi, I was wondering if anyone could help. I have a spreadsheet with 4 worksheets in it. I need to create a Table of Contents on the first sheet listing th other 39 sheets in the document. Does anyone know a quick way to generate a list of the sheets in th workbook? Any help would be appreciated. Thanks, Mark Piitchford -- Message posted from http://www.ExcelForum.com Hi have a look at http://www.mvps.org/dmcritchie/excel/buildtoc.htm -- Regards Frank Kabel Frankfurt, Germany > Hi, > > I was wondering if anyone could help. I have a spreadsheet with 40 > worksheets in it...

Open file(2) from file(1) and then close file(1)
I need to open a file(2) when I open file(1) and then close file(1) File(1) name can change so I need variables. sequence will be Open File(1) Open File(2)... I do it by the following macro: Public LaunchFile As String 'in this public variable I want to keep file(1) name Private Sub Workbook_Open() Dim lDir, lFile, lFileMtr As String lDir = Sheets("launch").Range("B2") & "\" 'direction of my file to open lFile = Sheets("launch").Range("B3") & ".xls" 'file name to openm lFi...

Posting to a new year without closing the previous year
Hi, I need to clear some doubts about entering transactions in a current year without closing the previous year Is GL posting to a new year not allowed Is Transaction affecting the Inventory quantities not allowed. Thanks Asma Asma: You can post to both inventory and GL without closing the current year. In GL there will be no issues whatsoever. In inventory there will be some smartlist objects and other information that will not be correct when you look at some historical "year to date", "current year", or "prior year" type inquiries and reports. "...

Error when closing Process Server
I am getting an error when closing the Process Server. The error title bar: DDE Server Window: Dynamics.exe - Application Error Error Message: The exception unknown software exception (0xc00200001) occurred in the application at location 0x77e4bee7. Click on OK to terminate the program Has anyone seen this error before, or know how to correct? Windows 2003 Server, GP10 sp2... ...