CPGDeveloper
Board Regular
- Joined
- Oct 8, 2008
- Messages
- 190
This may be beyond the scope of this board, but thought I'd give it a shot --
I have a VB Script that connects to a SQL DB, an exports a query in Excel. I can run it from the command line and it executes perfectly:
cscript "\\network\folder\folder\"VBScript.vbs
When I create a SQL Server Agent Job to execute the same script, however, it fails. The type is 'Operating System (CmdExec)' and I'm running it with a Proxy I created -- the proxy is based on my own credentials. I'm simply calling the vb script that I have saved on a network drive, exactly as I call it from the command line. This method works for simpler scripts, which copy, move, or rename files. But it fails with this script, as it cannot seem to create the instance of Excel. I get the following error --
Microsoft VB Script Error: Active X component can't create object 'Excel.Application' -- referencing the following line of code:
OApp = CreateObject("Excel.Application")
Again -- this works perfectly fine when I run it from the command line, but errors out here. Perhaps there's something basic I'm missing. Any thoughts would be greatly appreciated. Thanks!
I have a VB Script that connects to a SQL DB, an exports a query in Excel. I can run it from the command line and it executes perfectly:
cscript "\\network\folder\folder\"VBScript.vbs
When I create a SQL Server Agent Job to execute the same script, however, it fails. The type is 'Operating System (CmdExec)' and I'm running it with a Proxy I created -- the proxy is based on my own credentials. I'm simply calling the vb script that I have saved on a network drive, exactly as I call it from the command line. This method works for simpler scripts, which copy, move, or rename files. But it fails with this script, as it cannot seem to create the instance of Excel. I get the following error --
Microsoft VB Script Error: Active X component can't create object 'Excel.Application' -- referencing the following line of code:
OApp = CreateObject("Excel.Application")
Again -- this works perfectly fine when I run it from the command line, but errors out here. Perhaps there's something basic I'm missing. Any thoughts would be greatly appreciated. Thanks!