Do not save changes

lucky

New Member
Joined
Feb 28, 2002
Messages
18
Hi all

I have a command button that closes the active workbook and activates another workbook that is already open....

Private Sub CommandButton1_Click()
ActiveWorkbook.Close
Windows("Database.xls").Activate
End Sub

When this button is clicked the user may be asked if they wish to save changes. I dont want them too.
Is it possible for a worksheet to NOT ask "Do you wish to save changes?" when it is closed (i.e when this command button is clicked)?? and only save changes when they File-Save.....

Thanks for your time.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Just use this code (please use like below: i changed the ActiveWorkbook.Close line place, it should better located as the last command line.

Private Sub CommandButton1_Click()
Windows("Database.xls").Activate
'Next line does what you need
Workbooks("name or index").Saved = True
ActiveWorkbook.Close
End Sub


Regards


_________________
Oz ~ TheWordExpert
This message was edited by smozgur on 2002-04-03 07:08
 
Upvote 0

Forum statistics

Threads
1,213,554
Messages
6,114,280
Members
448,562
Latest member
Flashbond

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top