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?
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?
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]
If by "references", you mean references to libraries, my first curiosities would be to what is missing and why?Originally Posted by richardSmith
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