PC Review


Reply
Thread Tools Rate Thread

Can't remove problem reference

 
 
Ian
Guest
Posts: n/a
 
      1st Nov 2007
I'm trying to remove a reference which is marked as Missing on any machine
except my laptop (where the workbook was created).

Using the code below, I can identify all the correct references, but not the
problem one, so I can't remove it.

Set VBProj = Workbooks("II Checklist.xlt").VBProject
On Error Resume Next
For Each chkRef In VBProj.References
Debug.Print chkRef.Name
If chkRef.Name = "RefEdit" Then
VBProj.References.Remove chkRef
End If
Next

On my laptop the Debug.Print line produces the following in the Immediate
window:

Excel
stdole
Office
MSForms
RefEdit

On another machine, the output misses out the last line (RefEdit). The
problem is that, as I can't call up the name of the reference, I can't
delete it.

Any ideas, anyone?

TIA

Ian


 
Reply With Quote
 
 
 
 
Ian
Guest
Posts: n/a
 
      2nd Nov 2007
I've bitten the bullet on this one and emailed everyone with replacements
for the faulty workbook. I wish I could have figured out what the problem
was, though. I hate to have to give up!!

Ian

"Ian" <(E-Mail Removed)> wrote in message
news:k9jWi.23063$(E-Mail Removed)...
> I'm trying to remove a reference which is marked as Missing on any machine
> except my laptop (where the workbook was created).
>
> Using the code below, I can identify all the correct references, but not
> the problem one, so I can't remove it.
>
> Set VBProj = Workbooks("II Checklist.xlt").VBProject
> On Error Resume Next
> For Each chkRef In VBProj.References
> Debug.Print chkRef.Name
> If chkRef.Name = "RefEdit" Then
> VBProj.References.Remove chkRef
> End If
> Next
>
> On my laptop the Debug.Print line produces the following in the Immediate
> window:
>
> Excel
> stdole
> Office
> MSForms
> RefEdit
>
> On another machine, the output misses out the last line (RefEdit). The
> problem is that, as I can't call up the name of the reference, I can't
> delete it.
>
> Any ideas, anyone?
>
> TIA
>
> Ian
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove XLA as a reference in VBA Parmigiano Microsoft Excel Programming 1 26th Feb 2007 01:59 PM
remove reference to a COM DLL Le, Thanh-Nhan Microsoft C# .NET 3 21st Dec 2004 07:55 AM
Word 2002 cross reference problem: Error! Reference source not found Sam Dutton Microsoft Word Document Management 0 31st Mar 2004 02:49 PM
How to remove missing reference and add reference for different Excel versions =?Utf-8?B?bHV2Z3JlZW4=?= Microsoft Excel Programming 2 15th Mar 2004 08:46 PM
Remove a reference Niklas Microsoft Excel Programming 8 11th Nov 2003 10:19 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:54 AM.