Disabling Save Function

  • Thread starter Thread starter TheRobsterUK
  • Start date Start date
T

TheRobsterUK

Is it possible to prevent someone from saving a spreadsheet? I have an
Excel app. that I am trying to sell and want to put a downloadable demo
version on my website, but don't want people to be able to save it.

I was thinking something along the lines of this, placed in the
ThisWorkbook VBA module:


Code:
--------------------
On ApplicationSave
MsgBox "Application cannot be saved"
Close Workbook
--------------------


I'm not sure of the exact syntax but would that work in principle?

Or does anyone have any other ideas for how I can create a 'trial'
version of the application which is disabled in some way so that people
still have to buy the full version in order to get full functionality?

Thanks
-Rob
 
I believe code similar to the following in the Workbook section of the code
should work

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
MsgBox "You are not allowed to save this workbook."
Cancel = True

End Sub
 
That seems to do the trick, thanks.

Is is possible to do something similar with the Print function? I.e.
disable it for that workbook. My app. has a report generation feature
that I also want to be able to disable for the trial version.

I've tried altering what you posted for the Save function so that it
works for the Print function as well but not had any luck. :confused:

Thanks
-Rob
 

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

Back
Top