debkev1010
01-21-2010, 10:46 AM
I have a userform that helps testers troubleshoot fault spreadsheets. I saved it as an Add-In (*.xla) on the network. If a tester wants to use the tool, they insert it as an Add-In to Excel spreadsheet. I would like the ability to upload changes to my userform to the network and then when a user opens a spreadsheet, it would automatically copy the latest and greatest userform to their VBA Project. I'm currently trying to do this with the VBA Extensibility library. I am able to remove the userform in the Active Project but I can't import the updated form right after removing the old one. If I manually remove it (without using code) and then launch the macro, the import line works and the newest form is launched:
Application.VBE.ActiveVBProject.VBComponents.Remove Application.VBE.ActiveVBProject.VBComponents("FaultTool")
Application.VBE.ActiveVBProject.VBComponents.Import ("N:\Tools\FaultTool.frm")
FaultTool.Show
Application.VBE.ActiveVBProject.VBComponents.Remove Application.VBE.ActiveVBProject.VBComponents("FaultTool")
Application.VBE.ActiveVBProject.VBComponents.Import ("N:\Tools\FaultTool.frm")
FaultTool.Show