Unanswered: How To Execute An Excel File Within DTS?
I need to execute an excel file (built with macro) whenever a date change is detected between 2 fields in my sql table.
DECLARE @command varchar(1000)
exec xp_cmdshell @command
In my Refresh_ABC.bat, I have the following line
Start Excel.exe "D:\ABC.xls"
When I tested the above script (from Declare... to @command) in query analyzer, nothing seems to happen. It shows The command(s) completed successfully. But my excel file was not refreshed at all. When I ran the batch file Refresh_ABC.bat on it's own, ABC.xls was refreshed so the batch file is working.
Next test, I placed the line Start Excel.exe "D:\ABC.xls" on SET @command = ......... line. Same problem, nothing happened.
Any idea what went wrong. Please advise. Thank you.