April 25, 2016 at 1:59 pm
Is there a script out there or some sort of stored procedure that will open an Excel file?
April 25, 2016 at 3:17 pm
Open for? Query?
Sure, linked servers can do this
http://www.sqlservercentral.com/Forums/Topic1037546-392-1.aspx
You can also use OPENROWSET
April 26, 2016 at 5:42 am
Not really. I have VBA programing built inside of the excel file and I just want to be able to open the excel file so that upon opening the VBA code will kick off and do its scripting. So mainly I just need to know if there is such code in SQL that can just open the excel file itself.
April 26, 2016 at 7:51 am
Nope, all SQL can do is access the data within the sheet. What you want (though why you would want this on a server is beyond me) is for Excel to open and run. First off, MS Office must be installed on the server for this to work (a showstopper for me), and then you have to run either a command or Powershell via SQL Agent to get it to start. I don't think you can do it (well anyway) through straight T-SQL, and you want to do it via Powershell more than likely.
April 27, 2016 at 8:43 am
There are issues, but you can use sp_OAxxx procs: http://www.sqlservercentral.com/Forums/Topic1033076-391-1.aspx
Maybe some other help or a way to automate things: https://www.simple-talk.com/sql/t-sql-programming/sql-server-excel-workbench/
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply