Force no save on workbook exit

R

R A

Hello

I have the following macro code performing a bit of a dance with sheets
in a workbook, and doing some date validation along the way. The code
works fine, however what I thought was supposed to be working is the
command to disable excel asking the user if they want to save:
----------------------------------------------------------
Sub workbook_open()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Visible = xlSheetVisible
Next ws
Application.Sheets("Sheet1").Select
Call Hide_Error
If Now >= Worksheets("Error").Range("AO241") Then
Confirm = MsgBox("This workbook has expired. Please contact support
for further assistance.", vbInformation + vbOKOnly, "Workbook Expiry")
If Confirm = vbOKOnly Then
Application.Quit
Else: Application.Quit
End If
End If
Me.Saved = True
End Sub
----------------------------------------------------------

Doesn't 'Me.Saved = True' do this?
Basically I want stop excel putting up a dialogue asking the user do
they want to save. Any suggestions on how I may be able to do this?

Thankyou.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top