Connecting Tech Pros Worldwide Forums | Help | Site Map

How to delete the missing References for VBA

S. van Beek
Guest
 
Posts: n/a
#1: Nov 13 '05
Dear reader,



For removing a reference in the VBA reference form I receive from Doug
Steele the following code:

...........

References.Remove refCurr

..........



By running this code the following error occur:



Error no. 17

Error description: Can't perform requested operation



The question is how can I unable the tick box (remove tick form tick box) in
the VBA references form for the missing (broken) references.



Thanks for any help.



Kind regards,

Simon van Beek



Curt
Guest
 
Posts: n/a
#2: Nov 13 '05

re: How to delete the missing References for VBA


I suggest you perform this task on a machine that has the "Missing"
references installed, after which, you can uninstall those references or
move the project to the machine that is missing the references.

It might prove beneficial if you post the names of the missing references...

Good luck,
Curt


"S. van Beek" <S.v.Beek@HCCnet.nl> wrote in message
news:431344ff$0$160$3a628fcd@reader1.nntp.hccnet.n l...[color=blue]
> Dear reader,
>
>
>
> For removing a reference in the VBA reference form I receive from Doug
> Steele the following code:
>
> ..........
>
> References.Remove refCurr
>
> ..........
>
>
>
> By running this code the following error occur:
>
>
>
> Error no. 17
>
> Error description: Can't perform requested operation
>
>
>
> The question is how can I unable the tick box (remove tick form tick box)
> in
> the VBA references form for the missing (broken) references.
>
>
>
> Thanks for any help.
>
>
>
> Kind regards,
>
> Simon van Beek
>
>[/color]


Terry Kreft
Guest
 
Posts: n/a
#3: Nov 13 '05

re: How to delete the missing References for VBA



Seeing the whole of the code would be more useful as in the snippet you show
it would appear that refCurr is a variable, we really need to know the code
around that line.

If you are doing something like this for example

Dim refCurr As Reference

For Each refCurr In References
If refCurr.IsBroken Then
References.Remove refCurr
End If
Next

Then this will fail (if you do have Missing references)

This on the other hand should succeed

Dim refCurr As Reference
Dim intX As Integer

For intX = References.Count To 1 Step -1
Set refCurr = References(intCount)
If refCurr.IsBroken Then
References.Remove refCurr
End If
Next

.... unless the Missing reference is an inbuilt one, but the code could be
changed to

Dim refCurr As Reference
Dim intCount As Integer

For intCount = References.Count To 1 Step -1
Set refCurr = References(intCount)
If Not refCurr.BuiltIn Then
If refCurr.IsBroken Then
References.Remove refCurr
End If
End If
Next

and then you really must disambiguate when checking references in case one
of them is broken so the code should really be.

Dim refCurr As Access.Reference
Dim intCount As Integer

For intCount = Access.References.Count To 1 Step -1
Set refCurr = Access.References(intCount)
If Not refCurr.BuiltIn Then
If refCurr.IsBroken Then
Access.References.Remove refCurr
End If
End If
Next

Now do you see why the surrounding code is important ?

--
Terry Kreft
MVP Microsoft Access


"S. van Beek" <S.v.Beek@HCCnet.nl> wrote in message
news:431344ff$0$160$3a628fcd@reader1.nntp.hccnet.n l...[color=blue]
> Dear reader,
>
>
>
> For removing a reference in the VBA reference form I receive from Doug
> Steele the following code:
>
> ..........
>
> References.Remove refCurr
>
> ..........
>
>
>
> By running this code the following error occur:
>
>
>
> Error no. 17
>
> Error description: Can't perform requested operation
>
>
>
> The question is how can I unable the tick box (remove tick form tick box)[/color]
in[color=blue]
> the VBA references form for the missing (broken) references.
>
>
>
> Thanks for any help.
>
>
>
> Kind regards,
>
> Simon van Beek
>
>[/color]


Closed Thread