Hello guys,
I have a problem to solve using xll Addin built with Excel DNA. I need to change references in VBA code programmatically - remove broken (MISSING:) references and replace them with new ones pointing to different location.
Let's say I have this C# command wb.VBProject.References.Remove(refToRemove) to remove the ref.
When user opens a workbook, it is is available to me as Excel DNA Application.WorkbookOpen event argument. However it is fired after Excel's Sub Workbook_Open() and after any Function code is bound.
This leads to errors thrown by VBA just after workbook has been loaded, saying reference does not exist before I have a chance to replace it from within the addin's code.
If you have any thoughts or suggestions how can I solve this problem please share.
Thanks,
Vladimir