PDA

View Full Version : Porting UserForm to network of users



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

Bob Phillips
01-21-2010, 02:31 PM
Why not just store the version number in the addin, stoes a simple text file on the network that the addin reads to see if it is uptodate, i not give the user a message telling them to download it.

debkev1010
01-21-2010, 05:02 PM
so is there a way to configure an Add-In so that it will execute code when an Excel spreadsheet is opened (the code would then copy the latest userform into the Add-In)?

debkev1010
01-25-2010, 04:25 PM
I've created 2 Add-ins. Add-in 1 removes a user form from Add-in 2. Add-in 2 imports the latest and greatest version of the user form from the network. I've opened a workbook (Book1.xls) and added the 2 Add-ins. When I open the Visual Basic Editor, I see 3 VBA Projects (Book1.xls, Add-in 1.xla, and Add-in 2.xla). I've created 2 custom buttons on the Visual Basic toolbar on Sheet1. When I try to assign the macro in Add-in 1 that removes the user form in Add-in 2 to the first button, Excel doesn't give me a list of the macros that I can see in the VB Editor window. I've tried to manually assign the macros by pathname, but no success.