Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import module in protected project? [email protected] Excel Programming 0 January 5th 05 07:38 PM
Import useerfom, module in .xlt Raymond[_7_] Excel Programming 0 January 21st 04 01:00 PM
Remove VBA Project module TMR Excel Programming 0 December 11th 03 07:04 PM
Import module with vba sandy98 Excel Programming 2 November 13th 03 03:18 PM
Remove VB Module from workbook Nikos Yannacopoulos[_2_] Excel Programming 2 October 3rd 03 02:11 PM


All times are GMT +1. The time now is 12:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"