PDA

View Full Version : Solved: Stored Procedure not executing from scheduled task?



debauch
05-25-2009, 02:01 PM
Hello,

I am currently using SQL Server Express 2008 on a PC to help transform some of my data for excel reports.

One in particular is scheduled (via windows scheduled tasks) to execute each morning so it's ready for use when we all arrive to work.

So I've scheduled the report to run a stored procedure on 'workbook open()' and it just does a workbook refresh all via VBA.

Here is the weird part - it works if I open the file manually, however when it runs via the scheduled task the file looks like it's trying to refresh the data but it's almost like it cannot make a connection to the DB or something .... it basically times out/runs forever until i crash it.

Why would the code on workbook open > refresh all work manually opening the workbook but not through scheduled task???

debauch
05-27-2009, 12:18 PM
I believe i've resolved this.

Opposed to a 'refresh all' vba, I tried selecting each worksheet to refresh....for some reason when i do each sheet individually via code, it seems to work with the scheduled task?? Resolved.