+ Reply to Thread
Results 1 to 3 of 3

How can you check that other references you want to call are avaliable on that machine?

  1. #1
    Registered User
    Join Date
    12-09-2012
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    15

    How can you check that other references you want to call are avaliable on that machine?

    I'm making a document that should have the option to be printed to a PDF using PDFCreator. However, this document will be placed on various machines - not all of which will have PDFCreator installed. (It should also be assumed that I will not have administrator access)

    Therefore, what is the best way to check whether PDFCreator is avaliable?

    I was thinking of using Late-Binding and then checking after I try to set the object, so something like:
    Please Login or Register  to view this content.
    Would this work?
    I don't have regular access to the machines without PDFCreator, so I want to have a good idea that my code is right before I try it out.

    Is there a more efficent way, that could be done before calling the print pdf code?

  2. #2
    Forum Contributor PingPing's Avatar
    Join Date
    02-19-2010
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    158

    Re: How can you check that other references you want to call are avaliable on that machine

    You are correct to be using Late Binding. However, using CreateObject in your example will result in a run-time error (if the "PDFCreator" assembly is not installed and registered on a user's machine. Therefore, you could handle this error using standard 'On Error' methodology for example:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-09-2012
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: How can you check that other references you want to call are avaliable on that machine

    I knew there was something I was forgetting - of all things, I can't believe I forgot VB has Try/Catch statements.
    Thanks PingPing, that makes a lot more sense than what I was trying to do.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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