Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default Can't remove problem reference

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default Can't remove problem reference

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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove XLA as a reference in VBA Parmigiano Excel Programming 1 February 26th 07 01:59 PM
Remove a Reference scott Excel Programming 1 February 1st 05 12:01 AM
Remove reference names latha Excel Programming 4 August 3rd 04 01:13 AM
Add Remove DLL reference in VB Alex Excel Programming 8 June 14th 04 01:34 PM
Remove a reference Niklas[_3_] Excel Programming 8 November 11th 03 10:19 AM


All times are GMT +1. The time now is 06:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"