Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove and Import Module
I need to replace a module in selected workbooks with a module having the
same name. I'm using the Remove method of the VBComponents collection to remove the module. I'm also using the Import method to import a module from a *.bas file. The problem is: ....the module isn't 'removed' immediately following processing of the Remove method, therefore, since a module with the same name still exists, ....when the Import processes, the new module is given the name with a '1' at the end ....when processes ends...the 'removed' module is finally 'removed' Is there a way to complete the Remove prior to the Import so that the imported module will not have the '1' in the name? Thanks, -- Richard |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove and Import Module
Richard,
Pls see my post of yesterday which contains code which does exactly as you describe and which works fine. Only problem l can envisage without seeing your code is that my code is contained in a "control" type of workbook which is independent from the workbook which needs modifying. If you try and run the code in the workbook which needs modifying you will have problems which l believe is caused by the way the project is compiled. Chip Pearson has some great coding / tips about this on his website www.cpearson.com Regards Michael Beckinsale "Richard" wrote in message ... I need to replace a module in selected workbooks with a module having the same name. I'm using the Remove method of the VBComponents collection to remove the module. I'm also using the Import method to import a module from a *.bas file. The problem is: ...the module isn't 'removed' immediately following processing of the Remove method, therefore, since a module with the same name still exists, ...when the Import processes, the new module is given the name with a '1' at the end ...when processes ends...the 'removed' module is finally 'removed' Is there a way to complete the Remove prior to the Import so that the imported module will not have the '1' in the name? Thanks, -- Richard |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Import module in protected project? | Excel Programming | |||
Import useerfom, module in .xlt | Excel Programming | |||
Remove VBA Project module | Excel Programming | |||
Import module with vba | Excel Programming | |||
Remove VB Module from workbook | Excel Programming |