468,765 Members | 1,698 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,765 developers. It's quick & easy.

Missing references in VBA code

Dear reader,

I still have a problem with my reference libraries.

In my frond end application a check procedure for missing references is
available.

The problem I confronted with is that in case there is a missing reference
each VBA code in the frond end runs into an error, also the reference check
procedure.

After unable the tick box in the VBA reference form for the missing
reference library the check procedure runs perfect.

How can I unable the tick box (remove tick in tick box) in the VBA reference
form for the missing (broken) reference before VBA code runs into an error.

Thanks for any help.

Kind regards,

Simon van Beek
Nov 13 '05 #1
3 4614
I gave you an answer for this a few hours ago. Did you need complete code?

Untested air-code:

Dim intLoop As Integer
Dim refCurr As Reference

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

(Note that you need to loop backwards through the collection, since if you
delete, say, reference 2, what used to be reference 3 becomes reference 2
and you'll end up skipping it)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"S. van Beek" <S.******@HCCnet.nl> wrote in message
news:43*********************@reader2.nntp.hccnet.n l...
Dear reader,

I still have a problem with my reference libraries.

In my frond end application a check procedure for missing references is
available.

The problem I confronted with is that in case there is a missing reference
each VBA code in the frond end runs into an error, also the reference
check
procedure.

After unable the tick box in the VBA reference form for the missing
reference library the check procedure runs perfect.

How can I unable the tick box (remove tick in tick box) in the VBA
reference
form for the missing (broken) reference before VBA code runs into an
error.

Thanks for any help.

Kind regards,

Simon van Beek

Nov 13 '05 #2
Douglas,

Tanks for your help, but the question how to remove the broken reference
remains.

The code
If refCurr.IsBroken then
Shows the broken reference, so far so goot, but the next stap
Reference.Remove refCurr
Gives an error
Error no.: 17
Error description: Can't perform requested operation"

The question remains how to remove the tick from the tick box in the VBA
code.

Tanks for any suggestion.

Kind regards,
Simon van Beek
"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> schreef in bericht
news:F7********************@rogers.com...
I gave you an answer for this a few hours ago. Did you need complete code?

Untested air-code:

Dim intLoop As Integer
Dim refCurr As Reference

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

(Note that you need to loop backwards through the collection, since if you
delete, say, reference 2, what used to be reference 3 becomes reference 2
and you'll end up skipping it)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"S. van Beek" <S.******@HCCnet.nl> wrote in message
news:43*********************@reader2.nntp.hccnet.n l...
Dear reader,

I still have a problem with my reference libraries.

In my frond end application a check procedure for missing references is
available.

The problem I confronted with is that in case there is a missing reference each VBA code in the frond end runs into an error, also the reference
check
procedure.

After unable the tick box in the VBA reference form for the missing
reference library the check procedure runs perfect.

How can I unable the tick box (remove tick in tick box) in the VBA
reference
form for the missing (broken) reference before VBA code runs into an
error.

Thanks for any help.

Kind regards,

Simon van Beek


Nov 13 '05 #3
I'm sure I've had it work in the past, but I'm afraid I don't have the time
to try and create a situation where I have a broken reference to test right
now.

As I believe I said before, it's generally a poor idea to write your
application to remove broken references. Far better is to ensure that your
references don't break. You do this by having a minimal set of references,
and using Late Binding wherever possible.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"S. van Beek" <S.******@HCCnet.nl> wrote in message
news:43*********************@reader20.nntp.hccnet. nl...
Douglas,

Tanks for your help, but the question how to remove the broken reference
remains.

The code
If refCurr.IsBroken then
Shows the broken reference, so far so goot, but the next stap
Reference.Remove refCurr
Gives an error
Error no.: 17
Error description: Can't perform requested operation"

The question remains how to remove the tick from the tick box in the VBA
code.

Tanks for any suggestion.

Kind regards,
Simon van Beek
"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> schreef in bericht
news:F7********************@rogers.com...
I gave you an answer for this a few hours ago. Did you need complete
code?

Untested air-code:

Dim intLoop As Integer
Dim refCurr As Reference

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

(Note that you need to loop backwards through the collection, since if
you
delete, say, reference 2, what used to be reference 3 becomes reference 2
and you'll end up skipping it)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"S. van Beek" <S.******@HCCnet.nl> wrote in message
news:43*********************@reader2.nntp.hccnet.n l...
> Dear reader,
>
>
>
> I still have a problem with my reference libraries.
>
> In my frond end application a check procedure for missing references is
> available.
>
> The problem I confronted with is that in case there is a missing reference > each VBA code in the frond end runs into an error, also the reference
> check
> procedure.
>
> After unable the tick box in the VBA reference form for the missing
> reference library the check procedure runs perfect.
>
>
>
> How can I unable the tick box (remove tick in tick box) in the VBA
> reference
> form for the missing (broken) reference before VBA code runs into an
> error.
>
>
>
> Thanks for any help.
>
>
>
> Kind regards,
>
> Simon van Beek
>
>



Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Zlatko Matić | last post: by
reply views Thread by S. van Beek | last post: by
reply views Thread by A.Black | last post: by
1 post views Thread by Ulrich Wisser | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.