Professional Web Applications Themes

LoadFile method: VBA crashes. Well, any othermethod crashes as well. - Adobe Acrobat SDK

Hi there, I've got Acrobat reader 7.0 (correctly installed etc) In Excel 2003 VBA, I reference "Adobe Acrobat 7.0 Browser Control Type Library 1.0", create an instance of AcroPDFLib.AcroPDF and try to use it... The only method that appears to work is the GetVersions (which I appreciate but don't really need). All the rest methods cause Excel to crash. Of course, I tried LoadFile method first, but it kept failing so I tried others just to see what'd happen... However, if I place AcroPDF control on the UserForm, it works. But I don't need it as well, I want to ...

  1. #1

    Default LoadFile method: VBA crashes. Well, any othermethod crashes as well.

    Hi there,

    I've got Acrobat reader 7.0 (correctly installed etc)
    In Excel 2003 VBA, I reference "Adobe Acrobat 7.0 Browser Control Type Library 1.0", create an instance of AcroPDFLib.AcroPDF and try to use it...

    The only method that appears to work is the GetVersions (which I appreciate but don't really need). All the rest methods cause Excel to crash. Of course, I tried LoadFile method first, but it kept failing so I tried others just to see what'd happen...

    However, if I place AcroPDF control on the UserForm, it works. But I don't need it as well, I want to be able to silently and invisibly load PDF's and print particular pages from them.

    The effect is stable and shows on every PC I tried it on.

    Can please anyone explain what happens?
    Is that true that this "type library" appears in References dialog just to bring some mess, and thus should be ignored, because only visual control can be used?
    If yes, can anyone suggest the way to accomplish my task (see above)?
    I don't insist on PDF's actually. If there's a way to print specified pages from files that "Print to file" option produces (with or without (sorry! :) ) Acrobat products), it'll be great too.

    Thanks in advance.
    GSerg@adobeforums.com Guest

  2. #2

    Default Re: LoadFile method: VBA crashes. Well, anyother method crashes as well.

    I don't know if the answer is there, but have you checked what the IAC
    Overview and IAC Reference say? I mention this because you sound as if
    you may have only studied the object browser rather than the
    doentation.

    Aandi Inston
    Aandi_Inston@adobeforums.com Guest

  3. #3

    Default Re: LoadFile method: VBA crashes. Well, anyother method crashes as well.

    You're right :)

    You see, I've been developing software for... let me see... 5 years. That gave me some experience of "If-THAT-happens-it-means-THIS" kind of things. Particulary, when I make a mistake (like, using a COM object improperly), it usually raises an exception. Yes, if I make mistake in my driver, my system dies. Or if I mess up with subclassing, my application crashes. That's fine, that's OK and that's how it should be. But third-party COM component should raise an exception. Or its function should return "You dumbass!" value. And if it crashes, that quite clearly shows to me that there's an error in it (sorry once again :) ) - either that, or the component was developed so negligently that it doesn't perform even basic error checking and everything...

    However.
    Yes, you're right (as I already said). I'll be studying these two.
    I have to, anyway :)

    Thanks for pointing that out. I'll post some more nagging if I don't find there what I want :)
    GSerg@adobeforums.com Guest

  4. #4

    Default Re: LoadFile method: VBA crashes. Well, anyother method crashes as well.



    You see, I've been developing software for... let me see... 5 years.




    You never read the available doentation?
    Bernd Alheit Guest

  5. #5

    Default Re: LoadFile method: VBA crashes. Well, anyother method crashes as well.

    So, is that a way of saying you never did read the doentation?

    Aandi Inston
    Aandi_Inston@adobeforums.com Guest

  6. #6

    Default Re: LoadFile method: VBA crashes. Well, anyother method crashes as well.

    I do read the doentation - and even write it sometimes.

    I do not always START from reading doentation. Because those 5 years usually help to sort out things. But anyway, I DO read doentation to make myself sure that I've done everything right. But this reading sometimes occurs after everything is working.

    Hmmm... sounds like if I were programming in Monte-Carlo way, although I don't :)
    I mean, somethimes the object model of the component is so well designed, and the error messages are so well-written, that you can easily build everything without a single line of a manual. Sometimes that's not true, and I believe this is the case too :) That's why I really LOVE MSDN and sure that it's the best thing MS has ever created.

    Well, back to our topic :)
    So. I've had a look at IAC Reference. It contains descriptions (quite obvious and useless) of the methods plus some general words.

    Let's have a look.
    "AxAcroPDFLib.AxAcroPDFAn object containing a set of methods that provide access to PDF browser controls. This is a creatable interface. This object makes it possible to load a file, move to various pages within the file, and specify various display and print options."

    That's all regarding the object I need.
    Yup.
    Well, there are methods description, but we're not there at the moment.

    Please, those of you who are experienced with that, tell me in the straightforward way. Yes, it is possible to create an instance and load pdf into it without displaying the control. Or No, it is not possible.

    If Yes, point out the place in the doentation that shows where I'm mistaking, please. Because I didn't find it there.

    Oh, and regarding second one, Overview. I tried to download it, I was requested to register, I registered, and then got 403: Forbidden. Sorry if the answer is there, I just can't get it.
    GSerg@adobeforums.com Guest

  7. #7

    Default Re: LoadFile method: VBA crashes. Well, anyother method crashes as well.



    Yes, it is possible to create an instance and load pdf into it without
    displaying the control. Or No, it is not possible.




    Not with this interface, which is meant to be displayed.

    To invisibly load and print PDF files, use the DDE interface.
    chicks@adobeforums.com Guest

  8. #8

    Default Re: LoadFile method: VBA crashes. Well, anyother method crashes as well.

    That's funny.

    In my first post, I mentioned that I've got Acrobat Reader 7.0.
    No, I haven't got Acrobat. I've only got Reader. And the question was - how to do everything with it.

    Use DDE... I thought that was a good idea, but...

    After a while I was allowed to get my Overview.pdf (at last). From it I learned 2 marvelous things:
    - what's the name of the DDE server (NOT listed in the Reference.pdf anywhere), and that
    - Reader does not support DocPrint command. It supports only FilePrint, which prints all pages at the same time, which I don't need.

    So the answer is No, it's not possible.
    GSerg@adobeforums.com Guest

Similar Threads

  1. cs3 crashes on mac
    By neverrx8 in forum Macromedia Contribute General Discussion
    Replies: 1
    Last Post: May 18th, 10:22 PM
  2. Net::FTP crashes on ftp->get()
    By rna8arnold in forum PERL Modules
    Replies: 2
    Last Post: February 17th, 12:54 AM
  3. web app crashes.
    By in forum ASP
    Replies: 0
    Last Post: August 25th, 01:02 PM
  4. PS 7 Crashes
    By Carl B. Johnson in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 0
    Last Post: July 22nd, 02:32 PM
  5. Win xp pro crashes when log off
    By David Colligan in forum Windows XP/2000/ME
    Replies: 0
    Last Post: July 9th, 03:56 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139