I have a following problem: at work i'm using excel 2003 where at home i have 2010. If i try to run file created at work, macros do not work as 2010 do not have "Microsoft Office Web Components 11.0".
To disable missing refrences i'm using following code:
But it doesn't remove that Web Components. Is there a way to improve this code or is there a way to declare what refrences to use and what not to use?Sub References_RemoveMissing() Dim theRef As Variant, i As Long On Error Resume Next For i = ThisWorkbook.VBProject.References.Count To 1 Step -1 Set theRef = ThisWorkbook.VBProject.References.Item(i) Sheets("Start").Cells(100 + i, 1).Value = ThisWorkbook.VBProject.References.Item(i) If theRef.isbroken = True Then ThisWorkbook.VBProject.References.Remove theRef End If Next i If Err <> 0 Then MsgBox "A missing reference has been encountered!" _ & "You will need to remove the reference manually.Open VB Editor (Alt+F11) And Go To Tools->References and unclick the missing one", _ vbCritical, "Unable To Remove Missing Reference" End If On Error GoTo 0 End Sub
Thanks for your help!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks