Problem updating source data of chart -
11-12-2004
, 12:22 PM
I am trying to use an ActiveX script task to update the source data of a
chart in Excel. The code works as a macro in Excel, but when I move it to
DTS I get the error:
Error Source : Microsoft Data Transformation Services (DTS)
Error Description : Error Code: 0
Error Source= Microsoft VBScript compiliation error
Error Description: Expected statement
Error on Line 14
Here is the code:
'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************
Function Main()
Main = DTSTaskExecResult_Success
Set MsExcObj = CreateObject("Excel.Application")
Set wbk = GetObject("\\server\share\charttest.xls")
MsExcObj.Visible = False
'***** Update Summary Chart
wbk.Worksheets("Summary_Chart").Select
(Line 14)wbk.Worksheets("Summary_Chart").SetSourceData
Source:=Sheets("Summary").Range("A1:A24,F1:F24"), PlotBy:=xlColumns
wbk.Parent.Windows(wbk.Name).Visible = True
wbk.Save
MsExcObj.Quit
Set wbk = Nothing
Set MsExcObj = Nothing
End Function
Any help would be appriciated.
Thanks,
Mike |