View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Tom Chau Tom Chau is offline
external usenet poster
 
Posts: 4
Default VB Project References

Dear all,

I encountered a great problem while dealing with the references in
Excel VB project.

I have some operations to perform every month. Since the operation
detail will always change in a unpredicatble way, I decide to backup
the entire directory to some archive locations.

To resolve the XLA absolute path, I write some VBA code to localize the
XLA in the backup directory.

Dim refList As References
Dim ref As Reference

Set refList = oWorkbook.VBProject.References
For Each ref In refList
If ref.Name = "ABC" Then
refList.Remove ref
End If
Next

Set ref = refList.AddFromFile("Location of ABC to be archived.")
MsgBox ref.FullPath

What I encounter is that the AddFromFile() does not work at all if the
addin "ABC" is opened.
Do anyone have idea on that?

Thanks a lot.

Tom