D
dipsy
I want to put the file name and the file path in a
variable that I can use throughout the code by just using
the variable.
This is the code I wrote:
Dim fileName As String
fileName = "C:\Documents and Settings
\My Documents\2004\Data\HistoricalData.xls"
ActiveChart.SetSourceData Source:=Workbooks
(fileName).Sheets("By Year").Range("A1:E13"),
PlotBy:=xlColumns
Gives me - Run Time Error 9 Subscript out of range.
TIA
variable that I can use throughout the code by just using
the variable.
This is the code I wrote:
Dim fileName As String
fileName = "C:\Documents and Settings
\My Documents\2004\Data\HistoricalData.xls"
ActiveChart.SetSourceData Source:=Workbooks
(fileName).Sheets("By Year").Range("A1:E13"),
PlotBy:=xlColumns
Gives me - Run Time Error 9 Subscript out of range.
TIA