Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I need to create a bunch of graphs and wanted to quickly write a little macro that would replicate the same layout for all the required graphs.
So I started to write some lines of code but quickly hit a problem. Here is the (simplified) code:
Function CreateGraphs()
Set chart = ActiveDocument.ActiveSheet.CreateLineChart
chart.AddDimension "=IF([DeterminationCode]='XYZ', [SamplingTime])"
chart.AddExpression "MeasurementValue"
End Function
For some reason, this line "chart.AddDimension" is silently ignored. If I add the same calculated dimension interactively: no problem, all is working perfectly. But I'm unable to reach the same result via the macro.
It looks like this issue has already been raised in a previous post but I could find the right way to workaround the issue.
Any suggestion to help me?
Thanks a lot, have a great day.
--
Gaëtan
Stefan,
Thanks for your help, I finally found it:
chart.ChartProperties.NumericX = True
Have a wonderful day.