Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Copy Macro to a new workbook

How do I copy a existing macro to a new workbook using macro?
--
Saalim
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Copy Macro to a new workbook


Here is the definitive answer:

'Programming In The VBA Editor'
(http://www.cpearson.com/excel/vbe.aspx)


--
The Code Cage Team

Regards,
The Code Cage Team
http://www.thecodecage.com
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=30424

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Copy Macro to a new workbook

Thanks a lot for the link.

I use Excel 2003. The time I run this code, I get "Compile error;
User-defined type not defined".

I think I have declared all the variables correctly.

The code stops at the first line:

Function CopyModule(ModuleName As String, _
FromVBProject As VBIDE.VBProject, _
ToVBProject As VBIDE.VBProject, _
OverwriteExisting As Boolean) As Boolean

Please help.
--
Saalim


"The Code Cage Team" wrote:


Here is the definitive answer:

'Programming In The VBA Editor'
(http://www.cpearson.com/excel/vbe.aspx)


--
The Code Cage Team

Regards,
The Code Cage Team
http://www.thecodecage.com
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=30424


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Copy Macro to a new workbook


Read Chips page carefully, you will see that you need to make sure you
have checked a reference in your reference library, in the VBE goto
TOLLSREFERENCES and set the reference he gives you there.


--
The Code Cage Team

Regards,
The Code Cage Team
http://www.thecodecage.com
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=30424

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Copy Macro to a new workbook

Thanks a ton!! :-)
--
Saalim


"The Code Cage Team" wrote:


Read Chips page carefully, you will see that you need to make sure you
have checked a reference in your reference library, in the VBE goto
TOLLSREFERENCES and set the reference he gives you there.


--
The Code Cage Team

Regards,
The Code Cage Team
http://www.thecodecage.com
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=30424




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default Copy Macro to a new workbook

I use Excel 2003. The time I run this code, I get "Compile error;
User-defined type not defined".


In VBA, you need to go to the Tools menu, choose References, and then
scroll down to "Microsoft Visual Basic For Applications Extensibility
Lbrary 5.3" and check that item. It is in that library that the types
for VBProject, VBComponent and similary objects are defined.

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Mon, 17 Nov 2008 05:16:00 -0800, Saalim
wrote:

Thanks a lot for the link.

I use Excel 2003. The time I run this code, I get "Compile error;
User-defined type not defined".

I think I have declared all the variables correctly.

The code stops at the first line:

Function CopyModule(ModuleName As String, _
FromVBProject As VBIDE.VBProject, _
ToVBProject As VBIDE.VBProject, _
OverwriteExisting As Boolean) As Boolean

Please help.

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 one macro to another workbook Jay Excel Worksheet Functions 2 September 4th 08 06:03 PM
Macro to copy an image (or picture) from one workbook to a new sheetin another workbook Ruchir Excel Worksheet Functions 1 July 25th 08 07:29 AM
Copy workbook, don't copy macro CongroGrey Excel Discussion (Misc queries) 1 June 13th 08 04:56 PM
How can I copy a macro into another workbook? jbeene New Users to Excel 4 March 15th 07 06:53 PM
Copy macro to another workbook FTM Excel Discussion (Misc queries) 4 September 21st 06 08:48 PM


All times are GMT +1. The time now is 04:50 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"