ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Disabling Save Function (https://www.excelbanter.com/excel-discussion-misc-queries/28497-disabling-save-function.html)

TheRobsterUK

Disabling Save Function
 

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


--
TheRobsterUK


------------------------------------------------------------------------
TheRobsterUK's Profile: http://www.excelforum.com/member.php...fo&userid=9924
View this thread: http://www.excelforum.com/showthread...hreadid=375199


galimi

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
--
http://HelpExcel.com
1-888-INGENIO
1-888-464-3646
x0197758


"TheRobsterUK" wrote:


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


--
TheRobsterUK


------------------------------------------------------------------------
TheRobsterUK's Profile: http://www.excelforum.com/member.php...fo&userid=9924
View this thread: http://www.excelforum.com/showthread...hreadid=375199



TheRobsterUK


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


--
TheRobsterUK


------------------------------------------------------------------------
TheRobsterUK's Profile: http://www.excelforum.com/member.php...fo&userid=9924
View this thread: http://www.excelforum.com/showthread...hreadid=375199



All times are GMT +1. The time now is 09:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com