Hi,
I was hoping someone with more experience than me could figure out why the highlighted code causes an error in the macro. This is only a snippet in the code but I think the only part that is important. Basically the procedure sets up an auto updating graph that accepts variables for : the worksheet it is embedded on, the worksheet the source data is on , the columns from which to use ranges from and the ActiveWorkbook.Names used. It is the ActiveWorkbook.Names that cause the problem. when I try to concatenate the name with the sheet name I get an error on the 'series' line of code (hilighted) if I omit the sheet name the error is fixed, but then all the graphs point to the same set of data. I need a way of automating the creation of a unique name. It seems that the best way would be to add the sheet name. If anyone can help me with this issue I would be really greatful. Thanks

Sub graphMaker(columnValueOne, columnValueTwo, nameInputOne, nameInputTwo)
Dim varOne As Range
Dim varTwo As Range
Dim nameOne As String
Dim nameTwo As String
Set varOne = Cells(4, columnValueOne)
Set varTwo = Cells(4, columnValueTwo)
Set SourceSheetName = Sheets(GeneratedPageName) 'ActiveSheet 

'   ***************** THIS IS POINT THAT GENERATES ERROR

nameOne = nameInputOne & "_" & SourceSheetName.name
nameTwo = nameInputTwo & "_" & SourceSheetName.name

'   **********************************************
Charts.Add
ActiveChart.ChartType = xlXYScatter
ActiveChart.SetSourceData Source:=Sheets(SourceSheetName.name).Range(varOne.Address & ":" & varTwo.Address)
ActiveChart.Location Where:=xlLocationAsObject, name:=NewSheetName
ActiveWorkbook.Names.Add name:=nameOne, RefersToR1C1:= _
"=OFFSET(" & SourceSheetName.name & "!R4C" & columnValueOne & ",0,0,COUNTA(" & SourceSheetName.name & "!C" & columnValueOne & ")-1)"
ActiveWorkbook.Names.Add name:=nameTwo, RefersToR1C1:= _
"=OFFSET(" & SourceSheetName.name & "!R4C" & columnValueTwo & ",0,0,COUNTA(" & SourceSheetName.name & "!C" & columnValueTwo & ")-1)"
ActiveChart.SeriesCollection(1).Formula = _

'   Error occurs here  ************************************

"=SERIES(," & SourceSheetName.name & "!" & nameOne & "," & SourceSheetName.name & "!" & nameTwo & ",1)"