View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Harlan Grove[_5_] Harlan Grove[_5_] is offline
external usenet poster
 
Posts: 97
Default macros and file security

"Ed" wrote...
One method of making sure macros are turned on is:
* Create a new worksheet. Place a large block of text on this sheet
explaining that the user must have macros turned on to use the file.
* Set the data pages of the file to VeryHidden, leaving only the text block
visible to the user.
* Set an AutoOpen macro that sets the opening page to VeryHidden, sets the
data pages to Visible, and opens the UserForm.

...

Depending on the level of user sophistication/perversity, users could open this
workbook with macros disabled, then create a new workbook with macros enabled,
and write macros in the second workbook to manipulate the first, unprotecting
and unhiding ABSOLUTELY EVERYTHING in the first workbook. No big deal to use an
internal password cracker first on the original workbook to make sure it's
completely unprotected.

Welcome to Excel development. There is no robust way to protect any content
stored in any Office application's document files.

Except . . . not entirely secure, but requiring more user sophistication to
crack, use a File Open password for your workbook. These are MUCH HARDER to
crack than internal passwords. Then use another workbook to open the
now-protected workbook via macros with macros enabled in it. The user could
still break into the second workbook and step through the macros, but as I said
above it'd require more sophistication.

Along this line, you could also write a small EXE using Automation (the facility
formerly known as OLE) to open or link to Excel and open the now-protected
workbook. It may be possible for users to step through such an EXE using a
debugger, but now it'd really take a high level of sophistication to beat the
system.

--
To top-post is human, to bottom-post and snip is sublime.