Disable saving in Excel 2007

35 pts.
Tags:
Excel 2007
Excel macros
Microsoft Excel
Office 2007
Hi, I need to get rid of the save option. I only want the sheet able save when the document is closed and it asks if you want to save. I do not want the document to be saved any other time.

Here is my document (Office 2007 Only).

http://www.savefile.com/files/1848919

It has been made to book out computer and laptop suites. Trouble is, some people delete others booked sessions and put their own in.

So I have a macro that locks a cell after data is entered into the cell. As the sheet is protected anybody trying to delete it afterwards cannot.

Trouble was they would have to enable macros to use the macro. That's like asking a thief to leave his address when he robs a bank. So the important sheets are very hidden & I have another macro that unhides them when you enable macros. Therefore they cannot access the other sheets until macros are enabled.

My last problem is that if they enable macros then save when they on the unhidden sheets & save, then quit without saving they document stays on the very hidden sheets. Which is not good as the macros are not enabled. Thanks!

Answer Wiki

Thanks. We'll let you know when a new response is added.

I had a reply to a different post “Disabling saving” by “Alan Moseley” that
solved this problem, from the website: (Office discussion groups)

Try this. In the VBA editor add a new Class Module called Class1. Insert
the following code into it:-

Dim WithEvents MyExcel As Application
Dim booAllowSave As Boolean
Private Sub Class_Initialize()
Set MyExcel = Application
booAllowSave = False
End Sub
Private Sub Class_Terminate()
Set MyExcel = Nothing
End Sub
Private Sub MyExcel_WorkbookBeforeClose(ByVal Wb As Workbook, Cancel As
Boolean)
booAllowSave = False
End Sub
Private Sub MyExcel_WorkbookBeforeSave(ByVal Wb As Workbook, ByVal SaveAsUI
As Boolean, Cancel As Boolean)
If booAllowSave = False Then
Cancel = True
End If
End Sub

Now insert a new module and add the following code into it:-

Dim MyClass As Class1
Public Sub Auto_Open()

This works perfectly great work Alan!!!!

And thanks to every1 else who has helpout too.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • hopetim
    Dear Sir/ Madam, I want to disable the save as on excell spread sheet in order to prevent it from saving. The document will be send to different users and it must be use and read only.
    10 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following