Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have the need to show/hide the chart caption via macro.
The layout of the chart title is controlled by a check box (Show Caption) in Caption tab .
I have added a button to run a macro to check/uncheck this control
A possible VB sub routine:
SUB ShowHide_TITLE
set chart = ActiveDocument.GetSheetObject("CH29")
set Prop = chart.GetProperties
' ????? Prop.???????=true
chart.SetProperties Prop
END SUB
is there a way for achieving this?
If any of the replies solved your problem, please mark as Correct. If any were Helpful, please mark as Helpful.
This is from the API Guide:
set myobj = ActiveDocument.GetSheetObject("CO01")
prop = myobj.GetProperties
prop.Layout.Frame.ShowCaption = true
myobj.SetProperties prop
Since Macros are Bad, I should suggest another method:
You could clone your chart and remove the caption on the close. Then you could use an action to show/hide the charts based on a variable or a field selection. No macros required.
Thank you very much for your support and prompt reply.
I'll use your suggestion.
I have another question, Where can I find the API Guide?
If any of the replies solved your problem, please mark as Correct. If any were Helpful, please mark as Helpful.
Tks for the guide.
the solution to use a variable to show or not the cloned table can be the right idea.
In order to the macro, I have used your code but It's not run.
I'm using a pivot tables.
This code should work for a pivottable:
set mybox = ActiveDocument.GetSheetObject("CH07")
set fr = mybox.GetFrameDef
fr.ShowCaption = true
mybox.SetFrameDef fr
Tkank you,
now the code is right.
Best Regards
Fineas