P
PFS
Hi,
I have a workbook which very-hides all of the sheets but one in the
BeforeSave and BeforeClose events.
So that if a user opens up the workbook without macros enabled all they
will see is the front page, nothing else. If they open it with macros
enabled and their password has been entered, it opens the rest of the
sheets. Got that working beautifully if you use Close or Save or even
in SaveAs in the newly created file.
I have found a loophole though, which I will try to explain.
When you have the original file (I will call this file A) and open it
up with macros enabled, enter a password, get into it and then, do a
"Save As" to File B.
Now I don't really understand what is happening but as Excel does the
"Save As", it goes through a process to close File A which doesn't seem
to invoke the WorkBook_BeforeClose event (which hides everything
again). So now we have File B open, and File A closed (by the SaveAs
command).
Consequently, you can close File B and then open File A, disable
macros, and then gain access to the whole spreadsheet because it hasn't
gone through a "normal" close procedure.
Any ideas on how to close this loophole
cheers
Paul
I have a workbook which very-hides all of the sheets but one in the
BeforeSave and BeforeClose events.
So that if a user opens up the workbook without macros enabled all they
will see is the front page, nothing else. If they open it with macros
enabled and their password has been entered, it opens the rest of the
sheets. Got that working beautifully if you use Close or Save or even
in SaveAs in the newly created file.
I have found a loophole though, which I will try to explain.
When you have the original file (I will call this file A) and open it
up with macros enabled, enter a password, get into it and then, do a
"Save As" to File B.
Now I don't really understand what is happening but as Excel does the
"Save As", it goes through a process to close File A which doesn't seem
to invoke the WorkBook_BeforeClose event (which hides everything
again). So now we have File B open, and File A closed (by the SaveAs
command).
Consequently, you can close File B and then open File A, disable
macros, and then gain access to the whole spreadsheet because it hasn't
gone through a "normal" close procedure.
Any ideas on how to close this loophole
cheers
Paul