excel - Working with ChartObjects -
i have quick question regarding modifying axes of chartobject vba in excel.
i have following code, modifies min/max value of axis based on data charting:
worksheets("durationbydate").chartobjects("durationbydatechart").activate activechart.axes(xlvalue) .minimumscale = idurmin - 2 .maximumscale = idurmax + 2 end this works well, don't "activating" objects if don't need to.
so tried following code:
with worksheets("durationbydate").chartobjects("durationbydatechart") _ .axes(xlvalue) .minimumscale = idurmin - 2 .maximumscale = idurmax + 2 end this code throws error:
run-time error '438': object doesn't support property or method
does know why seems chart needs active in order adjust axes?
add .chart near end of with statement:
with worksheets("durationbydate").chartobjects("durationbydatechart").chart.axes(xlvalue)
Comments
Post a Comment