ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Setting name of series - run-time error 1004 (https://www.excelbanter.com/excel-programming/389320-setting-name-series-run-time-error-1004-a.html)

Masol

Setting name of series - run-time error 1004
 
When I record macro in Excel 2003 and set name of series on a chart the
following code is saved:

ActiveChart.SeriesCollection(1).Name = "=Workbook1!R1C1"

When I do the same in Excel 2007, it generates:

ActiveChart.SeriesCollection(1).Name = "=Workbook1!$A$1"

Code from Excel 2003 does not work in Excel 2007 and vice versa - in both
cases I get run-time error 1004. How can I create code compatibile with both
versions of Excel?


All times are GMT +1. The time now is 10:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com