Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copy module across excel spreadsheets


Hi ,

I was trying to copy one module from an excel spreadsheet to anothe
and searched google for information and found this piece of code:

With ThisWorkbook
FName = .Path & "\code.txt"
.VBProject.VBComponents("Module2").Export FName
End With

Workbooks("Data.xls").VBProject.VBComponents.Impor t FName
Kill FName
End Sub


I tried this piece and it works fine. The issue I have is I would lik
to change the excel spreadsheet name dynamically , for example i wan
Workbooks("Data.xls") the "Data.xls" to be dynamic. Because I have
piece of macro which I want to copy across 100 other exce
spreadsheets.

Please guide me.

Thanks,
Gargya

--
Gargy
-----------------------------------------------------------------------
Gargya's Profile: http://www.excelforum.com/member.php...fo&userid=2659
View this thread: http://www.excelforum.com/showthread.php?threadid=39871

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
Copy vb module in all excel sheets sohraaz Excel Discussion (Misc queries) 1 July 21st 07 03:16 PM
How do I copy a new module to 200 workbooks with a macro? Patrick Young Excel Worksheet Functions 1 September 3rd 05 04:35 PM
Copy a code module quartz[_2_] Excel Programming 2 April 11th 05 08:01 PM
Copy module with code - amendment Stuart[_5_] Excel Programming 2 November 1st 04 07:40 AM
Is it possible to copy a code module using VBA? quartz Excel Programming 2 April 15th 04 09:49 PM


All times are GMT +1. The time now is 08:52 PM.

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"