Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Create Class Module using late binding

I have a code that creates a new workbook that has some macros within. One of
the is an event handler (I want some stuff to happen everytime a Pivot-Table
is updated).
I did it using early binding and it worked for me nut not to most of the
users. So I tried to switch to late binding.
I only need to know how to create a new class module.
Here is an example of what i did:

Sub Test1()
Dim module As Object
Set module = ThisWorkbook.VBProject.VBComponents.Add(1)
module.Name = "hola"
module.CodeModule.AddFromString ("'TESTING")


ThisWorkbook.VBProject.VBComponents.Item("ThisWork book").CodeModule.AddFromString ("'Just to see it works")
End Sub


Does anybody know how to get it done?
Thanks


--
Mariano
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Create Class Module using late binding

Most things you need to know about programming the VBE are he
http://www.cpearson.com/excel/vbe.htm

RBS

"Mariano B." wrote in message
...
I have a code that creates a new workbook that has some macros within. One
of
the is an event handler (I want some stuff to happen everytime a
Pivot-Table
is updated).
I did it using early binding and it worked for me nut not to most of the
users. So I tried to switch to late binding.
I only need to know how to create a new class module.
Here is an example of what i did:

Sub Test1()
Dim module As Object
Set module = ThisWorkbook.VBProject.VBComponents.Add(1)
module.Name = "hola"
module.CodeModule.AddFromString ("'TESTING")


ThisWorkbook.VBProject.VBComponents.Item("ThisWork book").CodeModule.AddFromString
("'Just to see it works")
End Sub


Does anybody know how to get it done?
Thanks


--
Mariano


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Create Class Module using late binding


Thanks, I saw that page (in fact, it helped me create the first version of
my app), but it doesn't say anything about class modules .

Greetings

--
Mariano Beguerisse


"RB Smissaert" wrote:

Most things you need to know about programming the VBE are he
http://www.cpearson.com/excel/vbe.htm

RBS


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Create Class Module using late binding

Got it, all I hat to do is create a class module somewhere else and export it
as a .cls file and then import it on the new workbook like this:

Sub Test1()
Dim clsName As String

clsName = "C:\SRC\XMedios\PvtUpdt.cls"

ThisWorkbook.VBProject.VBComponents.Import fname

End Sub


Chip Pearson seems to be the answer to everything.
Thanks!


--
Mariano Beguerisse


"RB Smissaert" wrote:

Most things you need to know about programming the VBE are he
http://www.cpearson.com/excel/vbe.htm

RBS


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
Late Binding examples of binding excel application HeatherO Excel Programming 13 March 17th 05 08:19 AM
Late Binding Todd Huttenstine[_3_] Excel Programming 3 April 30th 04 11:01 AM
Late Binding Cindy Excel Programming 11 April 23rd 04 03:34 PM
EARLY binding or LATE binding ? jason Excel Programming 6 February 26th 04 04:57 PM
DAO Late Binding? Sharqua Excel Programming 2 January 4th 04 02:05 AM


All times are GMT +1. The time now is 05:03 PM.

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

About Us

"It's about Microsoft Excel"