Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Missing data and "invalid references" | Charts and Charting in Excel | |||
"References" Missing in Excel???? | Excel Discussion (Misc queries) | |||
cell references increase by 3 per row "=I1" then "=I4" | Excel Discussion (Misc queries) | |||
Remove "Missing" reference in VB-Tools-References | Excel Programming | |||
References.Remove References(1) DOES NOT WORK for "MISSING:" Refs | Excel Programming |