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

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -