+ Reply to Thread
Results 1 to 2 of 2

VB Compile Error - User-defined type not defined

  1. #1
    Registered User
    Join Date
    08-27-2010
    Location
    Torrance, CA
    MS-Off Ver
    Excel 2007
    Posts
    7

    VB Compile Error - User-defined type not defined

    We have a message box that pops up when we want to print and select whether we want to print to the printer or to Acrobat Distiller. It used to work to print to pdf just fine (provided you had previously selected Distiller selected as the default printer), but within the last week, we started getting the above VB Compile error when we select print to Distiller.

    When you click debug after getting this VB error message, the row that it goes right to is the row
    Please Login or Register  to view this content.
    but when you scroll up, the one with the yellow highlight and the arrow that it bombs out on is the first row here:


    Please Login or Register  to view this content.

    When I asked online what might be wrong with the code, I was told

    Please Login or Register  to view this content.
    PdfDistiller I don't believe is a system-defined type.


    As this is the row it first takes you to when you click debug, I am inclined to agree with the person, but I don't know how to "define" it or change the code to make it work.
    Also have no clue why it used to work and now it doesn't. Makes me think that some new VB/Excel changes have come out that is now caused the code to be "defunct?"

    I also had a suggestion from someone that said

    If you want to keep the code as it is you'll need a reference to the PDFDistiller DLL Library, Tools>References...

    Or you could try late-binding using CreateObject to create and reference an instance of Distiller.

    But I have no clue how to do either. Again, any help would be greatly appreciated.
    Last edited by dbwiz; 09-09-2010 at 07:32 PM. Reason: did not put code tags around the code

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: VB Compile Error - User-defined type not defined

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Remember what the dormouse said
    Feed your head

+ 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