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

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Permission denied to create object (VB6, Excel & Acces 97)

    Author
    Topic
    #397457

    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.

    Viewing 3 reply threads
    Author
    Replies
    • #752979

      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

    • #752980

      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

    • #753055

      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.

    • #753056

      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.

    Viewing 3 reply threads
    Reply To: Permission denied to create object (VB6, Excel & Acces 97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: