4 Replies Latest reply: Mar 12, 2014 12:09 PM by Rachael Chan RSS

    Macro for resizing the window

    susvithrocks susvithrocks

      Hi all,

       

      I had written a macro for resizing the QlikView app as per the user size window .

       

      "Sub Zoom
      set vAutozoomSwitch = ActiveDocument.Variables("vZoom").GetContent
      If vAutozoomSwitch.String = "0" Then
      ActiveDocument.GetApplication.WaitForIdle
      ActiveDocument.ActiveSheet.FitZoomToWindow
      Else
      ActiveDocument.GetApplication.WaitForIdle
      Set prop = ActiveDocument.ActiveSheet.GetProperties
      prop.ZoomFactor = 1.0
      ActiveDocument.ActiveSheet.SetProperties prop
      End If
      End Sub "

       

      Then I used text box which helps to  resize the window to  standard size  and its vice versa with actions.

      This is working fine  on a single sheet .

       

      What I want is , by clicking the text box  on one  sheet it should get applied to all the sheets .

       

      I tried with document triggers but it doesn't helped me.

       

      Any help would be appreciated.

       

      Thanks in advance.

       

      Regards,

      Susvith

        • Re: Macro for resizing the window
          Juan Pedro Hidalgo

          Hey,

          i use this approach to fit the window to the user screen. Is not what you are asking but all the pages will fit when activated.

          -> Settings ->Sheet Propreties ->Triggers -> OnActivateSheet

          i run this macro:

           

          Sub Zoom

          ActiveDocument.GetApplication.WaitForIdle

          ActiveDocument.ActiveSheet.FitZoomToWindow

          End Sub

           

          Hope it helps you.

          Regards,

          Juan Pedro

            • Re: Macro for resizing the window
              susvithrocks susvithrocks


              HI juan,

               

              thanks for your reply.

               

              In my case I should give an option to end user for resizing window.

               

              Let me know if you have any solution for this.

               

              Regards,

              Susvith

                • Re: Macro for resizing the window
                  Marco Imperiale

                  Hi I use these macros linked to 4 different buttons (action->run macro)

                  Works well on client but doesnìt work in web browser (still don't know why, it seems on web macros are not allowed):

                   

                   

                  sub zoom_piu()

                    set mysheet=ActiveDocument.ActiveSheet

                    set sp=mysheet.GetProperties

                    sp.ZoomFactor = sp.ZoomFactor + 0.02

                    mysheet.SetProperties sp

                     Apply2All()

                  end sub

                   

                   

                  sub zoom_meno()

                    set mysheet=ActiveDocument.ActiveSheet

                    set sp=mysheet.GetProperties

                   

                    sp.ZoomFactor = sp.ZoomFactor - 0.02

                    mysheet.SetProperties sp

                    Apply2All()

                  end sub

                   

                  sub zoom_normal()

                    set mysheet=ActiveDocument.ActiveSheet

                    set sp=mysheet.GetProperties

                    sp.ZoomFactor = 1

                    mysheet.SetProperties sp

                    Apply2All()

                  end sub

                   

                  sub zoom_fit()

                    ActiveDocument.ActiveSheet.FitZoomToWindow

                    Apply2All()

                  end sub

                   

                  sub Apply2All()

                    ActiveDocument.GetApplication.WaitForIdle

                    ActiveDocument.ActiveSheet.ApplyZoomToAllSheets

                   

                  end sub