Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server DTS
|
SQL Server DTS Discussion specific to Data Transformation Service with SQL Server. General SQL Server discussions should use the general SQL Server forum. Readers of the book Professional SQL Server 2000 DTS with questions specific to that book should post in that book forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server DTS section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 31st, 2003, 05:20 PM
JHo JHo is offline
Registered User
 
Join Date: Dec 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JHo
Default Executing an excel sub in ActiveX task

I am opening an excel file in an ActiveX script task in a DTS package.

After opening the excel application and then the worksheet, I then want to run a subroutine in the worksheet.

Is there a way to execute a subroutine in an excel file by using an AcitveX script?

Thanks.

Here is how I am opening the worksheet.

Function Main()

    Dim Excel_Application
    Dim Excel_WorkBook
    Dim Excel_WorkSheet
    Dim iSheetCounter

    Dim sFilename
    Dim sSheetName

    sFilename = "C:\ExcelFile.xls"
    sSheetName = "Data"

    Set Excel_Application = CreateObject("Excel.Application")

    ' Open the workbook specified
    Set Excel_WorkBook = Excel_Application.Workbooks.Open(sFilename)

      Excel_WorkBook.Worksheets(sSheetName).Activate

'I want to call the subroutine here.

              Excel_WorkBook.Save


    'Clean Up our Excel Objects
    Set Excel_WorkSheet = Nothing
    Excel_WorkBook.Close
    Set Excel_WorkBook = Nothing
    Excel_Application.Quit
    Set Excel_Application = Nothing

    Main = DTSTaskExecResult_Success
End Function







Similar Threads
Thread Thread Starter Forum Replies Last Post
execute xl macro in DTS 2000 activex script task ismailc SQL Server DTS 1 December 14th, 2007 10:14 AM
Can this be done in excel VBA? (large task). frankjuel Excel VBA 0 July 23rd, 2007 07:44 PM
Execute Task from ActiveX Script Task PorcupineRabbit SQL Server DTS 1 January 10th, 2006 12:37 PM
ActiveX Task riga SQL Server DTS 1 October 21st, 2004 03:34 PM
Referencing an ActiveX DLL from Excel james gold Excel VBA 1 September 10th, 2003 10:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.