Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Broken References
I posted a few days ago and got the following cod to remove any 'MISSING'
References form my '97 file after it has been worked on in a newer version: Sub removebrokenreferences() Dim Counter As Integer With ThisWorkbook.VBProject.References For Counter = 1 To .Count If .Item(Counter).IsBroken Then .Remove .Item(Counter) End If Next End With End Sub I can't seem to get it to work properly. In my Reference box I have 7 ticked, the last 2 are 'MISSING' and are obviously the ones I want to remove. When I run the macro it gets rid of the first but not the second, is it something to do with the .Count bit? It counts 7 so checks 7 References, but after the 6th is checked and removed because it is broken there isn't a 7th to check so instead looks at an unticked reference which causes an error. The second 'MISSING' becomes the 6th in the box so is not checked. Is my theory correct? If so, is there a way around it? Thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to convert all 3d references to normal references in a workboo | Excel Discussion (Misc queries) | |||
How to convert all 3d references to normal references in a workboo | Excel Worksheet Functions | |||
Help with converting a block of cells with Absolute and mixed references to relative references | Excel Worksheet Functions | |||
How to rename references from range names to cell references | Excel Discussion (Misc queries) | |||
Named references broken on copied worksheet | Excel Discussion (Misc queries) |