Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Schenectady, New York, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ActiveX can't create object (Access 2007)

    We just upgraded our office to Office 2007 from Office 2003. The 2003 version ran the code below but now in 2007 we are getting the error message 'ActiveX can't create object'.

    The error occurs on the first 'Set' command.

    Does anyone know if there is a new format in 2007?

    Thank you

    Private Sub GoButton_Click()
    On Error GoTo Err_GoButton_Click

    Dim app As Object

    Dim AcroExchApp As Object
    Dim AcroExchPDDoc As Object
    Dim AcroExchAVDoc As Object
    Dim AcroExchPDBookmark As Object
    Dim strFileName As String
    Dim IntPos As Long
    Dim strBookMarkName As String

    ' Find the # location in the path_file_Bookmark string in text box
    IntPos = InStr(1, Me.Payment_Plan, "#")
    ' Get the path_file portion
    strFileName = Mid(Me.Payment_Plan, 1, IntPos - 1)

    ' Get the bookmark name
    strBookMarkName = Mid(Me.Payment_Plan, IntPos + 1, (Len(Me.Payment_Plan) - (IntPos)))

    DoCmd.SetWarnings (False)

    Set AcroExchApp = CreateObject("AcroExch.App")
    Set AcroExchAVDoc = CreateObject("AcroExch.AVDoc")
    Set AcroExchPDBookmark = CreateObject("AcroExch.PDBookmark")

    ' Show the Acrobat Exchange window
    AcroExchApp.Show

    ' Open the PDF containing the bookmark
    AcroExchAVDoc.Open strFileName, vbNull

    ' Get the PDDoc from the AVDoc for passing to GetByTitle
    Set AcroExchPDDoc = AcroExchAVDoc.GetPDDoc

    ' Get the bookmark from the document
    AcroExchPDBookmark.GetByTitle AcroExchPDDoc, strBookMarkName

    ' Jump to the specified bookmark
    AcroExchPDBookmark.Perform AcroExchAVDoc

    Exit_GoButton_Click:
    DoCmd.SetWarnings (True)
    Exit Sub

    Err_GoButton_Click:
    MsgBox Err.Description
    Resume Exit_GoButton_Click

    End Sub
    Don
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18> <img src=/S/flags/NewYork.gif border=0 alt=NewYork width=30 height=18> "Life on Earth is expensive, but at least it includes a free trip around the Sun."

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ActiveX can't create object (Access 2007)

    Which version of Windows are you using?

  3. #3
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Schenectady, New York, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ActiveX can't create object (Access 2007)

    Window's XP
    Don
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18> <img src=/S/flags/NewYork.gif border=0 alt=NewYork width=30 height=18> "Life on Earth is expensive, but at least it includes a free trip around the Sun."

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ActiveX can't create object (Access 2007)

    This probably won't help, but have you checked for missing references in Tools | References...?

  5. #5
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Schenectady, New York, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ActiveX can't create object (Access 2007)

    Sorry Hans. I should have added all my tries.

    I did have a missing reference to OWC11.DLL and LEDMeter.ocx and I removed them.

    The OWC11.DLL is no longer supported in new versions of Office and is Microsoft Web Componets11.0
    and LEDMeter.ocx which is a module to write to CD's from NERO. Our new machines use Roxio.

    I didn't see any relationship to these and the PDF document being created.
    Don
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18> <img src=/S/flags/NewYork.gif border=0 alt=NewYork width=30 height=18> "Life on Earth is expensive, but at least it includes a free trip around the Sun."

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ActiveX can't create object (Access 2007)

    I hope that someone who has Access 2007 (I don't) can help...

  7. #7
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Schenectady, New York, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ActiveX can't create object (Access 2007)

    Thanks Hans
    Don
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18> <img src=/S/flags/NewYork.gif border=0 alt=NewYork width=30 height=18> "Life on Earth is expensive, but at least it includes a free trip around the Sun."

Posting Permissions

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