Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
al al is offline
external usenet poster
 
Posts: 363
Default How to automating Excel from an SQL Server Script?

I have an Excel worksheet that is linked to an SQL stored procedure. I have
coded with VBA this worksheet to Open, Update the data from the SQL stored
procedure it is linked to, then copy this data to another worksheet, format
the columns and data, and close both worksheets.

The goal of this is to open, run, and close this Excel worksheet from
commands stored in an SQL script (view, stored procedure, function) that will
be called to run once a month.

Any ideas how to do this? Or is there a better way to do this? Should this
be posted somewhere else (where)?

Thanks ahead of time for your responses, and ideas!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default How to automating Excel from an SQL Server Script?

"Al" wrote:

I have an Excel worksheet that is linked to an SQL stored procedure. I have
coded with VBA this worksheet to Open, Update the data from the SQL stored
procedure it is linked to, then copy this data to another worksheet, format
the columns and data, and close both worksheets.

The goal of this is to open, run, and close this Excel worksheet from
commands stored in an SQL script (view, stored procedure, function) that will
be called to run once a month.

Any ideas how to do this? Or is there a better way to do this? Should this
be posted somewhere else (where)?

Thanks ahead of time for your responses, and ideas!!



You can use sp_OACrate (and simmilar) SQL Server stored procedure to work
with Excel from SQL Server, but I think this is not the easiest way to work
with COM objects (look in SQL Server Books Online for sp_OA* samples and
you'll see what I mean). If you already have VBA code that works, maybe you
can use Scheduled Tasks to run it once a manth from Excel, and avoid using
SQL Server stored procedures at all. (maybe using Workbook.Open event?)

Hope this helps.

--
urkec
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to save Excel file to the server. raj41977 Excel Discussion (Misc queries) 3 December 8th 05 02:48 PM
Excel 2003 Error Cannot Locate the Internet Server or Proxy Server Seabee Excel Discussion (Misc queries) 0 November 20th 05 12:03 AM
Excel 2000/XP script to Excel97 script hat Excel Programming 3 March 2nd 04 03:56 PM
Automating Excel with Java Script Jim Hudson Excel Programming 0 December 1st 03 02:26 PM
Automating Excel on a Server Matthew Wieder Excel Programming 1 August 26th 03 12:56 PM


All times are GMT +1. The time now is 10:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"