11 Replies Latest reply: Oct 29, 2010 10:39 AM by Chris Hopkins RSS

    zoom

    Chris Hopkins

      Hi,

      Is it possible to use a custom zoom instead of the standard :

      25% 50% 75% 100% 125% 150% 175% 200% 400%

      I know i can use the 'Fit Zoom to Window' option, but i would like if possible the user to input a zoom level themselves using an input box or selecting from a list box.

      Thanks

        • zoom
          Chris Hopkins

          any update on this?

          • zoom
            Tanel Rüütli

            I have played with this once.

            Here is a macro built around a variable called "zoom" (default value: 100%).

            The variable has "on input" trigger which runs the macro.

            You can change the variable via slider or buttons.

            Have fun!

             


            sub zoom
            zoomvalue = ActiveDocument.Evaluate("num(zoom)")
            set mysheet=ActiveDocument.ActiveSheet
            set sp=mysheet.GetProperties
            sp.ZoomFactor = zoomvalue
            mysheet.SetProperties sp

            ActiveDocument.GetApplication.WaitForIdle

            ActiveDocument.ActiveSheet.ApplyZoomToAllSheets
            end sub


              • zoom
                Chris Hopkins

                Thanks Tanel.. I am getting an error when tring to run the macro

                the edit module box appears with the error:

                 

                Type mismatch: 'sp.ZoomFactor'

                Have you got an example of this working you could upload please??



                  • zoom
                    Tanel Rüütli

                    should be working. Try variable value 1 then 1.1 or 0.9.

                    If still error, it could be local settings issue (decimal sep). Then use integers (100, 110) in variable and make division in macro:

                    change this line to: sp.ZoomFactor = zoomvalue * 0.01