PDA

View Full Version : [SOLVED] Protecting Page SetUp Properties



MWE
05-02-2005, 06:28 AM
protecting worksheet contents is pretty easy, but what if you want to protect, say, page setup properites, e.g., margins. One can disable the Page SetUp menu pick, but there are other ways to get to those properties; and disabling all avenues is pretty drastic.

I poked around the ojbect browser looking for something that might enable/disable page setup properties but found nothing

Any thoughts?

Jacob Hilderbrand
05-02-2005, 09:01 AM
Instead of disabling them, just set them with a macro. You can run the macro before the file is printed to ensure that it will always be set the way you want.

johnske
05-02-2005, 03:25 PM
Instead of disabling them, just set them with a macro. You can run the macro before the file is printed to ensure that it will always be set the way you want.


Exactly, there is a ThisWorkbook Before_Print you can use for this:


Private Sub Workbook_BeforePrint(Cancel As Boolean)
'put all your settings here
End Sub


HTH
John

MWE
05-03-2005, 06:29 AM
Exactly, there is a ThisWorkbook Before_Print you can use for this:Private Sub Workbook_BeforePrint(Cancel As Boolean)
'put all your settings here
End Sub

HTH
John
An interesting approach. I use that proc a lot but never thought about using it to override any page setup properties changed by a user.

Thanks