LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Tools...References shows "MISSING:" in front of 2 references

Hi Mike,

I'm not sure why you can't re-set the reference. Does wkbk2.xla have a
unique project-name, if not it should.

Maybe try programmatically removing missing ref's and adding required refs,
eg

Sub RemRefs()
''with ref to Extensibility
'Dim oProj As VBProject
'Dim oRef As Reference

''late binding
Dim oProj As Object
Dim oRef As Object

Set oProj = ThisWorkbook.VBProject
For Each oRef In oProj.References
If oRef.IsBroken Then
Debug.Print oRef.Name
oProj.References.Remove oRef
End If
Next

End Sub

Sub AddRef()
Dim oRef As Object
Dim sFullName As String
Dim sProjName As String

sProjName = "aaTmp"
sFullName = "C:\My Documents\Excel\tmp2b.xls"

On Error Resume Next
With ThisWorkbook.VBProject
Set oRef = .References(sProjName)
If oRef Is Nothing Then
Set oRef = .References.AddFromFile(sFullName)
End If
End With

MsgBox sProjName & vbCr & "Ref is set: " & Not oRef Is Nothing

End Sub

Probably better not to run this in your main addin, so change
ThisWorkbook
to
Dim wb as Workbook
Set wb = Workbooks("myAddinName")

Regards,
Peter T

"Mike Jamesson" wrote in message
...
I have a workbook (wkbk1) that references an xla (wkbk2.xla), both in the
same folder. On my machine it works find, when I upload it to my boss's
machine, the code breaks with "unidentified something or other" referring

to
a variable in wkbk2.xla. I then check the references, and wkbk2.xla is
listed, and checked, but the word "MISSING:" is in front of it. I tried
unchecking it and hitting OK, and that removed the reference. But now, if

I
go back into "Tools...References..." it won't let me add wkbk2.xla, gives

me
the message "Can't add a reference to the specified file". Please help!

Thanks in advance

Mike J



 
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
Missing data and "invalid references" Jordlaw Charts and Charting in Excel 0 September 11th 07 02:20 PM
"References" Missing in Excel???? Bob Barnes Excel Discussion (Misc queries) 4 March 1st 07 09:06 PM
cell references increase by 3 per row "=I1" then "=I4" jwk515 Excel Discussion (Misc queries) 3 May 9th 06 02:00 AM
Remove "Missing" reference in VB-Tools-References Alan Excel Programming 1 December 21st 04 03:37 AM
References.Remove References(1) DOES NOT WORK for "MISSING:" Refs Jamie Carper[_2_] Excel Programming 0 May 27th 04 04:22 PM


All times are GMT +1. The time now is 05:08 PM.

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"