Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Using macro, how can i get a specific column width (for example, the width of column number 2) in a straight table.
there is a way of doing so in a Pivot table with the GetPixWidths function, but it's not working with a straight table.
Thanks 🙂
Refael
Sub example2
set chart = ActiveDocument.GetSheetObject("CH01")
set p = chart.GetProperties
set expr = p.Expressions.Item(0).Item(0).Data.ExpressionVisual
expr.ColWidth = 250
chart.SetProperties p
end sub
try this in macro
sub example
set chart = ActiveDocument.GetSheetObject("CH01")
SET P = Chart.GetProperties
set expr = P.Expression.Item(0).DataExpressionVisual
expr.ColWidth = 120
chart.SetProperties P
end sub
note-- you can change the colwidth
Tnx for your response.
Already tried that, but it's not working for me.
It throws an error in this row: " set expr = P.Expression.Item(0).DataExpressionVisual"
Sub example2
set chart = ActiveDocument.GetSheetObject("CH01")
set p = chart.GetProperties
set expr = p.Expressions.Item(0).Item(0).Data.ExpressionVisual
expr.ColWidth = 250
chart.SetProperties p
end sub
Thanks it worked 🙂
but when i try to get the ColWidth it returns a number which is incorrect.
for example, "msgbox(expr.ColWidth)" prints 400 when the actual number is 134
maybe it's in a different format?