Consulting

Results 1 to 3 of 3

Thread: VBA to auto-remove missing Refernces

  1. #1

    VBA to auto-remove missing Refernces

    I am distributing a workbook as a .xla but some users who are using it do not have all of the same references installed. How can I just pragmatically use VBA to 'untick' the reference if it is not installed on the machine the user is opening it on?

  2. #2

    removing links code

    Try this:

    [vba]
    Sub Breaklinks()
    Dim Links As Variant
    Links = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks)
    For i = 1 To UBound(Links)
    ActiveWorkbook.BreakLink _
    Name:=Links(i), _
    Type:=xlLinkTypeExcelLinks
    Next i
    End Sub
    [/vba]

  3. #3
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    Quote Originally Posted by richardSmith
    I am distributing a workbook as a .xla but some users who are using it do not have all of the same references installed. How can I just pragmatically use VBA to 'untick' the reference if it is not installed on the machine the user is opening it on?
    If by "references", you mean references to libraries, my first curiosities would be to what is missing and why?

    For instance, if in the Excel program, you had early-bound a later version of Word than the user has installed, then the program cannot "adjust" for a version it knows not. If for instance, your program refers to a control not installed on the users machine, then likewise, stuff will fall over. I hope I am making sense.

    If you are indeed referring to library references, can you show the code, or better, a short example workbook?

    Mark

Posting Permissions

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