Results 1 to 2 of 2

Thread: How to set reference automatically

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Location
    India
    Posts
    1

    How to set reference automatically

    Has a COM component which should be set as a reference in Microsoft Project or any office application at runtime.

  2. #2
    Hyperactive Member SoftwareMaker's Avatar
    Join Date
    Mar 2001
    Location
    Elbonia with Dilbert and Wally
    Posts
    322
    I (dont think) you can set references to a COM object automatically. If you do not want to explicitly set the reference, you have to use Late Binding

    You have to set a reference to a COM object from your project explicitly. In this sense, you allow the COM to be early-bound which improves performance, speed among other things. Also that combined with the Option Explicit keyword really makes it less error-prone and debugging easier. The compiler will raise the error to you before your application can go Run-Time.

    If you do not want to set a reference to it at Design-Time and choose to activate it via Run-Time, use late-Binding via the Keyword

    Set x = CreateObject(yourServer.yourClass)

    Although late-binding is not advisable at all, it is sometimes needed.
    William T
    Software Architect / Chief Software Developer
    Softwaremaker.Net Pte Ltd
    http://www.Softwaremaker.net

    *** Things are always the darkest before they go pitch black ***

Posting Permissions

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



Click Here to Expand Forum to Full Width