+ Reply to Thread
Results 1 to 5 of 5

Opening Acrobat Reader using VBA

  1. #1
    Registered User
    Join Date
    11-09-2005
    Posts
    2

    Opening Acrobat Reader using VBA

    Though I have added the Acrobat Library under tools and references I get an error 429 which says ActiveX component cant create object. Can you please test this and see if you get to the bottom of this problem?

    Sub Open_PDF()
    Dim PDDoc As AcroPDDoc
    Dim i As Long
    Set PDDoc = CreateObject("AcroExch.PDDoc")
    i = PDDoc.Open("d:\test.pdf")
    End Sub
    Raam

  2. #2
    ODI
    Guest

    RE: Opening Acrobat Reader using VBA

    Some questions to clear up the situation:
    1) Which Version of Acrobat are you using?
    2) Do you only have Reader or also other Adobe Products on your PC?
    3) Which Object Library did you reference?

    This is not really an Excel problem, I would post it in Adobe Forums. Hier
    is a link to try: http://forum.planetpdf.com/

    Didem

    "Raam" wrote:

    >
    > Though I have added the Acrobat Library under tools and references I get
    > an error ‘429’ which says “ActiveX component can’t create object”. Can
    > you please test this and see if you get to the bottom of this problem?
    >
    >
    > Sub Open_PDF()
    > Dim PDDoc As AcroPDDoc
    > Dim i As Long
    > Set PDDoc = CreateObject("AcroExch.PDDoc")
    > i = PDDoc.Open("d:\test.pdf")
    > End Sub
    >
    >
    > --
    > Raam
    >
    >
    > ------------------------------------------------------------------------
    > Raam's Profile: http://www.excelforum.com/member.php...o&userid=28666
    > View this thread: http://www.excelforum.com/showthread...hreadid=484759
    >
    >


  3. #3
    ODI
    Guest

    RE: Opening Acrobat Reader using VBA

    Hi again!

    If you just want to open the document, try this:

    Sub Open_PDF()
    Dim RetVal As Double
    RetVal = Shell("C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe
    D:\test.pdf", vbNormalFocus)
    End Sub

    Change the path of Acrobat and of the file you want to open. If you don't
    know the path you can find it out in cmd-Window with two commands:

    C:\>assoc .pdf
    ..pdf=AcroExch.Document
    C:\>ftype AcroExch.Document
    AcroExch.Document="C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe"
    "%1"

    Hope this helps!
    Didem

    "Raam" wrote:

    >
    > Though I have added the Acrobat Library under tools and references I get
    > an error ‘429’ which says “ActiveX component can’t create object”. Can
    > you please test this and see if you get to the bottom of this problem?
    >
    >
    > Sub Open_PDF()
    > Dim PDDoc As AcroPDDoc
    > Dim i As Long
    > Set PDDoc = CreateObject("AcroExch.PDDoc")
    > i = PDDoc.Open("d:\test.pdf")
    > End Sub
    >
    >
    > --
    > Raam
    >
    >
    > ------------------------------------------------------------------------
    > Raam's Profile: http://www.excelforum.com/member.php...o&userid=28666
    > View this thread: http://www.excelforum.com/showthread...hreadid=484759
    >
    >


  4. #4
    smogerp
    Guest

    RE: Opening Acrobat Reader using VBA

    Hi, was having similar issues. I have a dynamic location where a document is
    saved and then I want to open the document. I tried what you had below. But
    when it tried to open it in Acrobat, I get an error in Acrobat "There was an
    error opening this document. The file does not exist". I tried:

    RetVal = Shell("C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe
    \\servername\AAAA-ABCDEFG20051114101850.pdf", vbNormalFocus)


    And

    sLocation = "\\servername\AAAA-ABCDEFG20051114101850.pdf"
    RetVal = Shell("C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe " &
    sLocation, vbNormalFocus)

    Neither one worked. I can open the file from Acrobat by the File/Open
    process. What I need to do is to open the file directly so users don't have
    to go find the document.

    Any suggestions?

    Thanks in advance.

    Phill

    "ODI" wrote:

    > Hi again!
    >
    > If you just want to open the document, try this:
    >
    > Sub Open_PDF()
    > Dim RetVal As Double
    > RetVal = Shell("C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe
    > D:\test.pdf", vbNormalFocus)
    > End Sub
    >
    > Change the path of Acrobat and of the file you want to open. If you don't
    > know the path you can find it out in cmd-Window with two commands:
    >
    > C:\>assoc .pdf
    > .pdf=AcroExch.Document
    > C:\>ftype AcroExch.Document
    > AcroExch.Document="C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe"
    > "%1"
    >
    > Hope this helps!
    > Didem
    >
    > "Raam" wrote:
    >
    > >
    > > Though I have added the Acrobat Library under tools and references I get
    > > an error ‘429’ which says “ActiveX component can’t create object”. Can
    > > you please test this and see if you get to the bottom of this problem?
    > >
    > >
    > > Sub Open_PDF()
    > > Dim PDDoc As AcroPDDoc
    > > Dim i As Long
    > > Set PDDoc = CreateObject("AcroExch.PDDoc")
    > > i = PDDoc.Open("d:\test.pdf")
    > > End Sub
    > >
    > >
    > > --
    > > Raam
    > >
    > >
    > > ------------------------------------------------------------------------
    > > Raam's Profile: http://www.excelforum.com/member.php...o&userid=28666
    > > View this thread: http://www.excelforum.com/showthread...hreadid=484759
    > >
    > >


  5. #5
    ODI
    Guest

    RE: Opening Acrobat Reader using VBA

    Hi!
    File path should come immediately after the programm path:
    "C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe D:\test.pdf"
    Try it with a local path, if it works try with a static server path and then
    a dynamic one to be able to localize the error source. I first had the same
    error and I recognized that the path syntax was not right. If you use
    variables, watch their values by debugging modus.

    Another try could be to map the server drive instead of using \\servername.

    Good night... (It's 10.30 pm hier!)

    "smogerp" wrote:

    > Hi, was having similar issues. I have a dynamic location where a document is
    > saved and then I want to open the document. I tried what you had below. But
    > when it tried to open it in Acrobat, I get an error in Acrobat "There was an
    > error opening this document. The file does not exist". I tried:
    >
    > RetVal = Shell("C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe
    > \\servername\AAAA-ABCDEFG20051114101850.pdf", vbNormalFocus)
    >
    >
    > And
    >
    > sLocation = "\\servername\AAAA-ABCDEFG20051114101850.pdf"
    > RetVal = Shell("C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe " &
    > sLocation, vbNormalFocus)
    >
    > Neither one worked. I can open the file from Acrobat by the File/Open
    > process. What I need to do is to open the file directly so users don't have
    > to go find the document.
    >
    > Any suggestions?
    >
    > Thanks in advance.
    >
    > Phill
    >
    > "ODI" wrote:
    >
    > > Hi again!
    > >
    > > If you just want to open the document, try this:
    > >
    > > Sub Open_PDF()
    > > Dim RetVal As Double
    > > RetVal = Shell("C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe
    > > D:\test.pdf", vbNormalFocus)
    > > End Sub
    > >
    > > Change the path of Acrobat and of the file you want to open. If you don't
    > > know the path you can find it out in cmd-Window with two commands:
    > >
    > > C:\>assoc .pdf
    > > .pdf=AcroExch.Document
    > > C:\>ftype AcroExch.Document
    > > AcroExch.Document="C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe"
    > > "%1"
    > >
    > > Hope this helps!
    > > Didem
    > >
    > > "Raam" wrote:
    > >
    > > >
    > > > Though I have added the Acrobat Library under tools and references I get
    > > > an error ‘429’ which says “ActiveX component can’t create object”. Can
    > > > you please test this and see if you get to the bottom of this problem?
    > > >
    > > >
    > > > Sub Open_PDF()
    > > > Dim PDDoc As AcroPDDoc
    > > > Dim i As Long
    > > > Set PDDoc = CreateObject("AcroExch.PDDoc")
    > > > i = PDDoc.Open("d:\test.pdf")
    > > > End Sub
    > > >
    > > >
    > > > --
    > > > Raam
    > > >
    > > >
    > > > ------------------------------------------------------------------------
    > > > Raam's Profile: http://www.excelforum.com/member.php...o&userid=28666
    > > > View this thread: http://www.excelforum.com/showthread...hreadid=484759
    > > >
    > > >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1