November 7, 2007 at 10:28 am
I am trying to find a way to execute VBA from within T-SQL.
More specifically, I have a stored procedure that creates an excel file as its output. I also have a macro that is applied to the excel file in order to apply the proper formatting before the spreadsheet is disseminated. I am trying to find some way to automatically run that macro against the new file from within the SQL stored procedure.
Any help that can be offered is appreciated.
---
Timothy A Wiseman
SQL Blog: http://timothyawiseman.wordpress.com/
November 7, 2007 at 6:09 pm
Why not just make it an auto-exec macro that get's executed when the spreadsheet is opened?
--Jeff Moden
Change is inevitable... Change for the better is not.
November 7, 2007 at 6:58 pm
That is a good idea, but the security settings on Excel default to disabling macros and of course the user will then see the macro running. If there is a way, I would greatly prefer to have it formatted and macro free when it goes out the end users.
---
Timothy A Wiseman
SQL Blog: http://timothyawiseman.wordpress.com/
November 7, 2007 at 7:27 pm
Create a formatted spreadsheet... use it as a template... use VBS to copy it to a new file... use OPENROWSET to populate the new file.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply