ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Reference a SQL DTS package in Excel Macro (https://www.excelbanter.com/excel-programming/275536-reference-sql-dts-package-excel-macro.html)

sib

Reference a SQL DTS package in Excel Macro
 
Client OS: Win2K
Client Excel Version: 2000
SQL Server: Version 7.0

I'm attempting to populate an Excel 2000 spreadsheet with
the results of an already created DTS package that uses a
SQL script to generate the result set. The DTS package
currently runs successfully, populating the targeted Excel
spreadsheet when launched from Enterprise Manager.

However, I want to execute the DTS from within an Excel
macro. I've coded a macro exactly as stated in KB
article - 306125 "HOW TO: Import Data from Microsoft SQL
Server into Microsoft Excel", and changed the necessary
elements to reference my database and such. This works
beautifully when I tested selecting from a SQL database
table.

Now, I wish to instead have this macro launch/execute the
DTS package instead of doing a .Open "SELECT
<enterstatementshere" command. Is this possible?

If so, does anyone know how to alter the code in this
article to reference and execute the SQL DTS package
Instead of executing a SQL Select statement? Thanks for
any help.

Sib



All times are GMT +1. The time now is 05:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com