What's the best way to prevent users from changing margins?

  • I hide my ribbon, so users can't change the margins from there.
    I am having absolutely no luck with Private Sub Workbook_BeforePrint(Cancel As Boolean)
    My best solution, so far, is the code below, which sets the margins when the user clicks the Print CommandButton.
    But it still doesn't prevent the user from changing the margins once they are in Print Preview.
    Can Page Setup be greyed out?
    Is there a way that even if the change it, it immediately reverts back to my default settings?
    Thanks


  • Re: What's the best way to prevent users from changing margins?


    I believe something along the following lines may work:


    Code
    Dim MyPrint As CommandBar
    Set MyPrint = Application.CommandBars("Worksheet Menu bar")
    MyPrint.Controls("&File").Controls("Print Pre&view").Enabled = False

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!