• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 258
  • Last Modified:

Execute SQL Packages

Hello,

I´m trying to find a way to execute a DTS Package using VBA in Excel.
0
Claudia_V
Asked:
Claudia_V
  • 3
  • 2
1 Solution
 
arbertCommented:
Add a reference into your VBA program for the Microsoft DTS Custom Tasks Object and the Microsoft DTSPackage object library.

You can then utilize all the properties and methods that are availabe to the DTS object model.

Brett
0
 
Claudia_VAuthor Commented:
Hello, Thanks for the answer. I have recently seen an example of what you are sugesting, but I can´t seem to make it work because I think I don´t have a certain library reference which I need, because he doesn´t recognize the objects DTS when I declare the variables.

Dim objPackage      As DTS.Package2
Dim objStep         As DTS.Step
Dim objTask         As DTS.Task
Dim objExecPkg      As DTS.ExecutePackageTask


These are all the objects he doesn´t recognize. Do tou perhaps know which is the library I´m missing????

Once again thanks for the help

0
 
arbertCommented:
Yes, like I said in my first post--you need a reference to
Microsoft DTS Custom Tasks Object and the Microsoft DTSPackage object library.  

In your VBA Editor, go to the tools menu, select references, and then select the Microsoft DTS libraries that I listed above.

hth
Brett
0
 
Claudia_VAuthor Commented:

Sorry didn´t get it the first time around. It works like a charm, thanks....
0
 
arbertCommented:
Great!

have fun
Brett
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now