Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I have just copied this macro from some old post, thus thought of creating new thread,
actually I want to use this macro in my app, but not able to figure out the changes I have to make.
Can somebody please guide me here ??
sub PrepareColumn
dim doc, obj, varColumnList, varColumn, varColumnVisible, varColumnWidth, i, ii
set doc = ActiveDocument
set obj = doc.GetSheetObject("CH10012")
varColumnVisible = doc.Variables("vHelpColumnVisible").GetContent.String
if varColumnVisible = "on" then varColumnWidth = 40 else: varColumnWidth = 0
varColumnList = doc.Variables("vHelpColumnList").GetContent.String
varColumn = split(varColumnList, ";")
for i = 0 to ubound(varColumn)
if instr(varColumn(i), "-") = 0 then
obj.SetPixWidth varColumn(i), varColumnWidth
else
for ii = cint(left(varColumn(i), instr(varColumn(i), "-") - 1)) to cint(mid(varColumn(i), instr(varColumn(i), "-") + 1))
obj.SetPixWidth ii, varColumnWidth
next
end if
next
end sub
Change then value CH10012 into the object id of the chart that you want the macro to modify
You may want to change the value of the variable varColumnWidth to something else than 40 too.