Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Houston, Texas, USA
    Posts
    303
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Permission denied to create object (VB6, Excel & Acces 97)

    I am running a VBscript in a Outllook form. When i get to this section I am having problems on this machine:
    'Call Excel
    Sub cmdExcel_click()
    Working
    update1
    update2
    forward1
    Set objWSHShell = CreateObject("WScript.Shell") ----------- Getting error at this point __________________
    objWSHShell.Run("excel.exe tabsproddatabaseedgarTerminationmasterterm3.xls")
    end sub

    get: Microsoft VBscript runtime error: Permission denied: 'CreateObject' - not sure what to do about this.

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Permission denied to create object (VB6, Excel & Acces 97)

    Perhaps the Scripting Host is disabled or not installed on the system. Try

    Sub cmdExcel_click()
    Dim xlApp
    Set xlApp = CreateObject("Excel.Application")
    With xlApp
    .Workbooks.Open ("tabsproddatabaseedgarTerminationmasterterm3.xls" )
    .Visible = True
    End With
    Set xlApp = Nothing
    End Sub

    Andrew C

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Permission denied to create object (VB6, Excel & Acces 97)

    I believe the Windows Script Host is "not safe for scripting" within the meaning of the security model. If you have high security for Outlook messages, which of course you should, it's possible that this code will not run until published to a trusted form library on Exchange Server. However, I don't use Exchange, so don't take my word for it.

Posting Permissions

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