Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro only works the first time?

I have a macro that is only working the first time it is executed with a button.  It also works when I push the test button from the Edit Module box.  This is getting a bit frustrating. Any thoughts???

Requested Module Security is Safe Only

Current Local Security is Safe Mode

Here's the code but I don't think its the problem.

 

Sub RestoreMainCharts()

' Temporarily turn off the AutoMinimize so that we can
' put 2 charts on the front panel without them auto-minimizing
' themselves.
SetAutoMinimize "CH74", false
SetAutoMinimize "CH75", false

ActiveDocument.GetSheetObject("CH74").Restore
ActiveDocument.GetSheetObject("CH75").Restore


SetAutoMinimize "CH74", true
SetAutoMinimize "CH75", true


' Minimize all the chart objects.
ActiveDocument.GetSheetObject("CH67").Minimize
ActiveDocument.GetSheetObject("CH68").Minimize
ActiveDocument.GetSheetObject("CH69").Minimize
ActiveDocument.GetSheetObject("CH70").Minimize
ActiveDocument.GetSheetObject("CH72").Minimize
ActiveDocument.GetSheetObject("CH73").Minimize



End Sub

Sub SetAutoMinimize(chart, state)
rem ** Set auto-minimize flag for a chart **
set g = ActiveDocument.GetSheetObject(chart)
set gp = g.GetProperties
gp.GraphLayout.Frame.AutoMinimize = state
g.SetProperties gp

End sub

Thanks--

1 Reply
Not applicable
Author

So it appears to be something with the button.  I deleted all the other actions except Run Macro and it Works.  I think I just need to inclued the code for the other actions.