Consulting

Results 1 to 4 of 4

Thread: How to add References to a VBA Project?

  1. #1
    VBAX Regular
    Joined
    Apr 2008
    Posts
    51
    Location

    How to add References to a VBA Project?

    Hi,

    I am new to Excel VBA.I have a requirement where i should add the References to a VBA Project programmatically.

    Is that possible do it using code?

    Regards,
    Krrishna

  2. #2
    VBAX Regular
    Joined
    Sep 2007
    Location
    Singapore
    Posts
    63
    It's possible. Check out these 2 articles in the KB:

    Adding a reference
    http://vbaexpress.com/kb/getarticle.php?kb_id=267

    How to identify a reference
    http://vbaexpress.com/kb/getarticle.php?kb_id=278

    I found them to be of great help when I had the same problem as you previously.

  3. #3
    VBAX Regular
    Joined
    Apr 2008
    Posts
    51
    Location
    Hi,

    when i run the above code its throwing a runtime error "can't break continue mode".

    How can we rectify this?I have used the same code you have given to me.

    Regards,
    Krrishna

  4. #4
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    You cannot step through the code and you will probably need Microsoft Extensibility Library reference setting and usually you need to have trusted access to the vba project.
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

Posting Permissions

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