Dave Peterson wrote...
#1. You could use another workbook that contains a macro that opens the real
workbook. If macros are disabled for that helper workbook, then the real
workbook won't open. If macros are enabled, then macros will be enabled for the
real workbook.
Another alternative is using a do-nothing udf in most formulas. For
example,
Function nada() : End Function
This will always return a VBA variant Empty value which Excel treats
the same as the value of blank cells, so add it to formulas that should
return numbers and concatenate it at the end of formulas that should
return text. If the user opens the workbook with macros disabled, all
formulas containing this udf will evaluate as errors. Add a message
formula like
=IF(ISERROR(nada()),"Nice try. You have to enable macros for this
workbook to calculate correctly. Close it an reopen it with macros
enabled.","")
But all this depends on the curiousity/honesty of the users. It isn't too
difficult to bypass the project's protection. Then the code could be modified
to avoid all this stuff.
....
Which is why the udf approach can be safer. While it may be easy to use
Edit > Replace to replace +nada() and &nada() with nothing, it gets
harder to deal with all the variations in which nada() could be used.
Add nada() calls to several defined names too. Still possible to
disable, but it can be made to take a LOT of effort to remove it from
all formulas and name definitions.