+ Reply to Thread
Results 1 to 4 of 4

Remove Reference from VBA Projects

  1. #1
    salut
    Guest

    Remove Reference from VBA Projects

    I was trying to remove missing references from VBA Projects. For example,
    this is the code I use if I want to remove "Microsoft ActiveX Direct Object
    2.7 Library"

    The error message I got is "Programmatic access to Visual Basic Project is
    not trusted". Could anybody help me out? Thanks a lot!

    ---------------------------------------------------------------------
    Sub removeRef()

    Dim Wkb As Workbook
    Set Wkb = ThisWorkbook
    With Wkb.VBProject.References
    .Remove (msado15.dll)
    End With
    End Sub
    ----------------------------------------------------------------------

  2. #2
    Mark
    Guest

    Re: Remove Reference from VBA Projects


    I think that message is related to having a Certificate of
    authenticity. You either have to create your own limited
    certificate(if you have the software) or you have to go through some
    process with Verisign Corp. The reason you cannot do this is
    protection to the system from vicious code. What you want to do can be
    done manually in the VBE pane but programatically is gonna be a problem.


  3. #3
    Bob Phillips
    Guest

    Re: Remove Reference from VBA Projects


    Since Excel 2002 there is a new macro security that you need to "approve" to
    perform VBA manipulation of VBProject objects.

    To set this,
    choose Tools/Macro/Security from the Excel menu,
    select the Trusted Sources tab
    put a check in the checkbox called "Trust Access to Visual Basic Project".



    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "salut" <[email protected]> wrote in message
    news:[email protected]...
    > I was trying to remove missing references from VBA Projects. For example,
    > this is the code I use if I want to remove "Microsoft ActiveX Direct

    Object
    > 2.7 Library"
    >
    > The error message I got is "Programmatic access to Visual Basic Project is
    > not trusted". Could anybody help me out? Thanks a lot!
    >
    > ---------------------------------------------------------------------
    > Sub removeRef()
    >
    > Dim Wkb As Workbook
    > Set Wkb = ThisWorkbook
    > With Wkb.VBProject.References
    > .Remove (msado15.dll)
    > End With
    > End Sub
    > ----------------------------------------------------------------------




  4. #4
    salut
    Guest

    Re: Remove Reference from VBA Projects

    Thanks a lot! Looks like I have to do it manually. The excel is installed on
    my company's computer, I guess I might not have enough authorization to do
    things like that.

    "Mark" wrote:

    >
    > I think that message is related to having a Certificate of
    > authenticity. You either have to create your own limited
    > certificate(if you have the software) or you have to go through some
    > process with Verisign Corp. The reason you cannot do this is
    > protection to the system from vicious code. What you want to do can be
    > done manually in the VBE pane but programatically is gonna be a problem.
    >
    >


+ 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