Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am relatively new to Excel so any help you could provide would be greatly appreciated. I have a macro that updates various (approx 550) that have been sent out to users. There was a problem with the templates and I need to delete missing references. The code I use to do this is shown below. Const ver As Integer = 1 Dim worksheetversion As Integer Dim currentRef As Object Dim response As Integer Dim i As Integer Dim theRef As Variant worksheetversion = wb.Worksheets("ENTITY_INFO").Cells(1, 2).value If Not (worksheetversion < ver) Then Exit Sub For i = wb.VBProject.References.Count To 1 Step -1 Set theRef = wb.VBProject.References.Item(i) If theRef.IsBroken = True Then 'On Error Resume Next wb.VBProject.References.Remove theRef 'On Error GoTo 0 End If Next i In the code, wb refers to a different workbook that is open and unprotected. In the for loop, when I get to the reference that is missing I get the following error: 'Object Library not registered'. It loops through all the references fine, but is erroring out only on the missing references. Any ideas what might be going wrong? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
External table/range reference trouble | Excel Programming | |||
Trouble with making a 3D reference absolute | Excel Discussion (Misc queries) | |||
A missing reference, maybe? | Excel Worksheet Functions | |||
I am having trouble deleting sheets in Excel | Excel Worksheet Functions | |||
Missing VBA Reference | Excel Programming |