Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import "ThisWorkbook"?
When I right-click and export the "ThisWorkbook" class module everything
works fine :-) But when I try to import it again it gets imported a a new seperate class-module with the name "ThisWorkbook1". How to directly import the "ThisWorkbook" into the original/true "ThisWorkbook" class-module, without having to copy and paste the imported code? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import "ThisWorkbook"?
The ThisWorkbook class module can't be imported/deleted.
But you can add procedures into it. Check Chip Pearson's site: http://www.cpearson.com/excel/vbe.aspx look for: Creating An Event Procedure ========== Another option that may be easier if you're creating a new workbook... Create a template file (*.xlt). Put all the code you need in that template's project--including all the events you want in the ThisWorkbook module. Then use that file as the template for the new workbook. Dim NewWkbk as workbook set newwkbk = workbooks.add(Template:="C:\yourpath\myfile.xlt") "Charlotte E." wrote: When I right-click and export the "ThisWorkbook" class module everything works fine :-) But when I try to import it again it gets imported a a new seperate class-module with the name "ThisWorkbook1". How to directly import the "ThisWorkbook" into the original/true "ThisWorkbook" class-module, without having to copy and paste the imported code? -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import "ThisWorkbook"?
You have to remove the original first, otherwise you get the situation that
you describe. -- __________________________________ HTH Bob "Charlotte E." wrote in message ... When I right-click and export the "ThisWorkbook" class module everything works fine :-) But when I try to import it again it gets imported a a new seperate class-module with the name "ThisWorkbook1". How to directly import the "ThisWorkbook" into the original/true "ThisWorkbook" class-module, without having to copy and paste the imported code? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import "ThisWorkbook"?
oops sorry, I only caught the class bit, missed THisWorkbook.
-- __________________________________ HTH Bob "Bob Phillips" wrote in message ... You have to remove the original first, otherwise you get the situation that you describe. -- __________________________________ HTH Bob "Charlotte E." wrote in message ... When I right-click and export the "ThisWorkbook" class module everything works fine :-) But when I try to import it again it gets imported a a new seperate class-module with the name "ThisWorkbook1". How to directly import the "ThisWorkbook" into the original/true "ThisWorkbook" class-module, without having to copy and paste the imported code? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Programatically adding macro to Excel - "ThisWorkbook" | Excel Discussion (Misc queries) | |||
Import data "Hangs", A "time out" is needed. Help! :) | Excel Programming | |||
Can I disable a macro in "Thisworkbook" with true or false? | Excel Programming | |||
How to use VBA to copy this code to "thisworkbook" objects of all opened workbooks ? | Excel Programming |