Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ttt
PFS wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Workbook_Open event not firing | Excel Programming | |||
Excel closing event of a specific file | Excel Programming | |||
Workbook_BeforeClose Event | Excel Programming | |||
OnTime event not firing in Workbook_Open event procedure | Excel Programming | |||
VBA capture File SaveAs Event | Excel Programming |