Hello Experts Exchange
I have a ActiveX Script and I'm trying to get it to work in a SQL Agent task.
The code is the following;
strExcelFile = "F:\Graham Rock\OEE Scripting\MouldingBlue561.xls"
strMacroName = "Macro1"
Set objExcel = CreateObject("Excel.Application")
Set objWB = objExcel.Workbooks.Open(strExcelFile)
objExcel.Visible = True
The script works when I run it as a VBS file.
But I get the following error when I try to save it to a SQL Agent task;
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
The command script does not destroy all the objects that it creates. Revise the command script. (.Net SqlClient Data Provider)
Can anyone help me to resolve the error please?