Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro for resizing the window

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

4 Replies
Not applicable
Author

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

Not applicable
Author


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

Marcoimp
Partner - Creator III
Partner - Creator III

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

M.Imperiale
Not applicable
Author

I am trying to create an Apply2All() for sheet user permissions. Do you know if that is possible? There is an "Apply to all sheets" check box in Sheet Properties>Security, but I don't know what the variable is called or how to call it.