Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
kd12345
Starting Member
12 Posts |
Posted - 2008-03-10 : 15:56:23
|
I'm trying to create new SSIS package and i'm using one of the control flow Item is "ActiveX Script Task". Following is script.When i execute the task it errors out that "Function not Found". do i need to create this Function first? I'm new to SQL 2005. so any suggestion will be appreciated.'**********************************************************************' Visual Basic ActiveX Script'************************************************************************Function Main()Dim srccsvfileDim objExcel Dim objWorkbook, objWorksheetsrccsvfile = "\\pc17917\c$\Documents and Settings\kdesai1\Desktop\CRM Daily Supervisor Report.xls"Set objExcel = CreateObject("Excel.Application")objExcel.Visible = FalseobjExcel.displayalerts = FalseSet objWorkbook = objExcel.Workbooks.open(srccsvfile)Set objWorksheet = objWorkbook.WorkSheets("DailyAllCases")objWorksheet.ActivateobjWorksheet.Delete 'this is removing the worksheet instead of rowsobjWorkbook.Save 'you must save the change otherwise in troubleobjExcel.Workbooks.CloseSet objWorkbook = NothingobjExcel.QuitSet objExcel = NothingMain = DTSTaskExecResult_SuccessEnd FunctionPlease Advice,KD |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-03-10 : 16:14:59
|
Active x script has lots of problem in SSIS. |
|
|
kd12345
Starting Member
12 Posts |
Posted - 2008-03-10 : 16:18:06
|
Same ActiveX Script i tried it in SQL 2000 DTS Package and it worked fine. i don't have to do anything. I don't need to register or anything like that?Thanks,KD |
|
|
dataguru1971
Master Smack Fu Yak Hacker
1464 Posts |
Posted - 2008-03-10 : 16:58:14
|
Same error came up in a post the other day, but it may be a different issue if there are problems with SSIS.here: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=98694Ahh this is related to the other post....Set objWorkbook = objExcel.Workbooks.open(srccsvfile)Set objWorksheet = objWorkbook.WorkSheets("DailyAllCases")objWorksheet.ActivateobjWorksheet.Delete 'this is removing the worksheet instead of rowsobjWorkbook.Save 'you must save the change otherwise in troubleif you delete the only worksheet in the file, you may get an error on the save.Do this instead of the DELETE for this post from earlier http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=98736objWorksheet.Cells.ClearContents Poor planning on your part does not constitute an emergency on my part. |
|
|
daxxman
Starting Member
1 Post |
Posted - 2009-02-23 : 15:09:26
|
make sure your entry method is defined as Main(). |
|
|
|
|
|