Results 1 to 3 of 3

Thread: ActiveX in a SQL Agent Job

Threaded View

  1. #1
    Join Date
    Nov 2002
    Location
    DE
    Posts
    246

    ActiveX in a SQL Agent Job

    Hi all,

    I have a problem with a SQL Agent JOB on SQL 2K SP3 installation (on Win2K Server).

    SQL Agent is running under a domain account with local Admin privileges and SA privileges in SQL server.

    A job with an ActiveXScript step fails with "Permission denied: 'CreateObject line..."

    If I execute the same ActiveXScript as cmdexec step (calling CSript with the VBScript as parameter) it works without any problem.

    The ActiveXScript for reference:
    Dim oXls
    Dim oWorkBook
    Dim oSheet

    Set oXLS = CreateObject ("Excel.Application")

    oXls.Visible = True
    oXls.DisplayAlerts = True

    Set oWorkBook = oXLS.WorkBooks.Add
    Set oSheet = oWorkBook.ActiveSheet

    oSheet.Name = "Test AG"

    oWorkBook.SaveAs "C:\Temp\TestAg.Xls"
    oWorkBook.Close

    Set oSheet = Nothing
    Set oWorkBook = Nothing

    oXls.Quit
    Set oXlS = Nothing


    Does anybody have any idea why approach 1 fails while approach 2 does work happily?
    Last edited by andi_g69; 02-22-2005 at 02:59 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •