Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can an excel macro be called from a SQL JOB

Status
Not open for further replies.

ghost2

Programmer
Aug 7, 2003
145
US
I have a SQL job that does an extract of data from a view to an excel file. I have been then opening the file and creating a pivot table and chart. I would like to automate the pivot table creation somehow as the next step after the creation of the excel file. Is this possible?
 
Yes it is, what you need is to develop a COM object for your automation and then call it from extended stored procedure. There is an article in SQL Server Mag about extended SPs, just go to the web site and read it. I think it will help you a great deal on what are you trying to do.
Best of luck

Walid Magd
Engwam@Hotmail.com
 
You probably don't need to develop a COM object since Excel itself is automatable. You might want to create some VB macro code within the workbook and run that.

To automate Excel and run your macros you will need to use T-SQLs COM interface sps.

This article gives a good, general purpose example:


TR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top