Sorry, I missed the fact that you're working with a chart in a drawing. The iLogic function will only work with Excel files linked to parameters in parts or assemblies.
You can do this in a drawing using the API in a rule. Here's a sample rule:
Dim excelFileName As String = ThisDoc.Path
If ChartSource = "A" Then
excelFileName = excelFileName & "\ExcelChartA.xls"
Else
excelFileName = excelFileName & "\ExcelChartB.xls"
End If
Dim doc as Document = ThisDoc.Document
Dim oleDesc As ReferencedOLEFileDescriptor
For Each oleDesc In doc.ReferencedOLEFileDescriptors
If (oleDesc.OLEDocumentType <> OLEDocumentTypeEnum.kOLEDocumentLinkObject) Then Continue For
If (Not oleDesc.FullFileName.Contains(".xls") ) Then Continue For
oleDesc.FileDescriptor.ReplaceReference(excelFileName)
Next
Here ChartSource is a parameter in the drawing. You could use different logic to drive the rule.
If you have more than one Excel or other OLE link in your drawing, you might have to add other logic to make sure that you replace only the one reference that you're looking for.
Mike Deck
Software Developer
Autodesk, Inc.