View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Vinod[_2_] Vinod[_2_] is offline
external usenet poster
 
Posts: 72
Default copying modules from one workbook to another workbook

Thanks Gord Dibben.

I captured code from provided link and I achieved it partly which is failing
in saving file after copying code from a module to 'Thisworkbook' and deleted
unnecessary modules.

At the end of copy and delete process I've wrorte like this: thisworkbook.save
while executing 'save' statement I got a message saying that 'Document not
save' with 'Ok' option.

Is there any workaround for this.
Please share your thoughts and relavent code which will be appreciated.

Advanced Thanks,
Vinod


"Gord Dibben" wrote:

Right-click on a module in book1 and Export as a *.bas file.

In book2 right-click on a module and Import File

Do this a few times and you've got the modules copied.

To do it programmatically see Chip Pearson's site

http://www.cpearson.com/excel/VBE.aspx

Copy A Module From One Project To Another


Gord Dibben MS Excel MVP

On Thu, 18 Sep 2008 10:21:02 -0700, Vinod
wrote:

I'm having 2 workbooks. I wanted to copy some of the modules from workbook1
to workbook2.

Note: Both workbooks are opend.

Please help me out by providing relavent VBA code.

Advanced Thanks,
Vinod