[dba-Tech] Excel VBA -- don't save

Susan Harkins ssharkins at gmail.com
Fri Sep 3 18:07:27 CDT 2010


This is what I was looking for -- I knew it was simple, but just couldn't 
find this!

Private Sub Workbook_BeforeClose(Cancel As Boolean)
    'Don't save this workbook. Don't display alert.
    Me.Saved = True
End Sub

Susan H.

----- Original Message ----- 
From: "Dan Waters" <df.waters at comcast.net>
To: "'Discussion of Hardware and Software issues'" 
<dba-tech at databaseadvisors.com>
Sent: Friday, September 03, 2010 12:56 PM
Subject: Re: [dba-Tech] Excel VBA -- don't save


> Hi Susan,
>
> I this that this command only closes the workbook, and that you need 
> another
> command to close Excel.
>
> How about DoCmd.Quit?
>
> Dan
>
> -----Original Message-----
> From: dba-tech-bounces at databaseadvisors.com
> [mailto:dba-tech-bounces at databaseadvisors.com] On Behalf Of Susan Harkins
> Sent: Friday, September 03, 2010 5:40 PM
> To: Discussion of Hardware and Software issues
> Subject: [dba-Tech] Excel VBA -- don't save
>
> I'm using the procedure included below in an Excel worksheet, to keep 
> Excel
> from saving any changes -- when the user clicks Close, I want Excel to 
> close
> without saving changes and without asking if the user wants to save 
> changes.
> This doesn't seem to work.
>
> Sub CloseActiveWBNoSave()
>  'Close the active workbook without saving.
>  ActiveWorkbook.Close False
> End Sub
>
> Any help?
>
> Susan H.
> _______________________________________________
> dba-Tech mailing list
> dba-Tech at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-tech
> Website: http://www.databaseadvisors.com
>
> _______________________________________________
> dba-Tech mailing list
> dba-Tech at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-tech
> Website: http://www.databaseadvisors.com 




More information about the dba-Tech mailing list