Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm trying to use the following script to change the the label of a dimension in a straight table:
Sub Test
set chart = ActiveDocument.GetSheetObject("CH01")
set cp = chart.GetProperties
set dims = cp.Dimensions
dims(0).Title.v = "Test"
chart.SetProperties cp
End Sub
The macro stops working as soon as I add the parentesis to the Dimensions object.
Es.:
set dims = cp.Dimensions --> OK!
set dims = cp.Dimensions(0) --> KO!
Have you ever experienced something like this?
Thanks in advance.
Sure. Try without the set. Better yet, don't use a macro to change the dimension label but use a variable as dimension label and change the value of the variable with for example an inputbox object.
Hi Gysbert, thank for the reply. Finally I understood why I was having this issue:
I was looping incuding system values so the error was generated not because of the Dimension object but because I reached the limit of it.
I solved using:
if not dimName.IsSystem then
cp.Dimensions(j).Title.v = dimName.Name