Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
With the help of RB Smissaert, I wrote a VBA proc which set a ref on Word before the main macro, then another which remove this ref. I tried to adapt this macro in a MS Project module: Sub BuildWordReference() Dim Ref As String Ref = "{00020905-0000-0000-C000-000000000046}" ActiveProject.VBProject.References.AddFromGuid Ref, 0, 0 End Sub The macro above worked 5 times, but doesn't work anymore ... ;-( Sometimes, I get the error message : "runtime error '32813' Module name, project or object library already used" The second macro, which is supposed to remove the ref, *never* worked ;-((( (No error message) Sub RemoveWordReference() RemoveReference "Word" 'Call End Sub Sub RemoveReference(strReference As String) On Error GoTo ERROROUT Dim R As Object For Each R In ActiveProject.VBProject.References If R.Name = strReference Then ActiveProject.VBProject.References.Remove R Exit Sub End If Next ERROROUT: On Error GoTo 0 End Sub Could you help me? Thanks ahead! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Dynamic Reference | New Users to Excel | |||
Dynamic reference of word doc in excel | Excel Discussion (Misc queries) | |||
How do i set up a 3d reference where one cell reference is dynamic | Excel Discussion (Misc queries) | |||
Dynamic reference to another tab name | Excel Worksheet Functions | |||
Dynamic References to Word? | Excel Programming |