dbTalk Databases Forums  

Problem updating source data of chart

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Problem updating source data of chart in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mike
 
Posts: n/a

Default 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



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.