Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
karin_nevo
Contributor III
Contributor III

Execute 2 macros in one button

Hi,

I am trying to create a button to set specific Zoom and apply it to all sheets.

I am using IE Plugin.

I was unable to create both actions in one macro, so I seperated it into 2 macros, but it only works if I am using 2 buttons (instead of one button with 2 actions).

the macros I am using are:

1. For Zoom:


sub ZOOM
set mysheet=ActiveDocument.ActiveSheet
set sp=mysheet.GetProperties
sp.ZoomFactor = 1.25
mysheet.SetProperties sp
  End sub

2. To apply to all sheets:

sub ApplyZoom
  ActiveDocument.ActiveSheet.ApplyZoomToAllSheets
End sub

Any idea how I can solve it?

thanks!

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

Hi Karin,

You can use below code.

Sub Zoom

For i = 0 to ActiveDocument.NoOfSheets - 1

  set mysheet=ActiveDocument.Sheets(ActiveDocument.Sheets(i).GetProperties.Name)

  set sp=mysheet.GetProperties

  sp.ZoomFactor = 1.25

  mysheet.SetProperties sp

Next

End sub

View solution in original post

3 Replies
tamilarasu
Champion
Champion

Hi Karin,

You can use below code.

Sub Zoom

For i = 0 to ActiveDocument.NoOfSheets - 1

  set mysheet=ActiveDocument.Sheets(ActiveDocument.Sheets(i).GetProperties.Name)

  set sp=mysheet.GetProperties

  sp.ZoomFactor = 1.25

  mysheet.SetProperties sp

Next

End sub

karin_nevo
Contributor III
Contributor III
Author

Thank you Tamil, it works perfectly

rubenmarin

Hi karin, if Tamil answer was what you are looking for, please check Tamil's answer as the correct answer to close the thread.

This helps other users with similar issue to find the answer and others (like me) to not use time reading an already solved question.