Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have an .ocx file named MyProject. It contains a class named MyClass which
contains two VBA functions. MyProject is referenced in Tools-References. Where do I put this line of code: Public oMyClass As New MyProject.MyClass so the following occurs: Anywhere in your Code you should now be able (supported by intellisense), to type oMyClass. .... and as soon as you type that, your list of functions inside MyClass should pop up and be usable inside VBA. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Make sure that MyClass is Public and creatable. Then, you should be able to
put the declaration in the "Declarations" section of a code module (NOT an object module like a class or ThisWorkbook), outside of and before any proc in that module. -- Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2008 Pearson Software Consulting, LLC www.cpearson.com (email on web site) "OfficeUser" wrote in message ... I have an .ocx file named MyProject. It contains a class named MyClass which contains two VBA functions. MyProject is referenced in Tools-References. Where do I put this line of code: Public oMyClass As New MyProject.MyClass so the following occurs: Anywhere in your Code you should now be able (supported by intellisense), to type oMyClass. .... and as soon as you type that, your list of functions inside MyClass should pop up and be usable inside VBA. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for responding, Chip!
What do you mean by "Make sure that MyClass is Public and creatable"? How do I do that? Thanks! "Chip Pearson" wrote in message ... Make sure that MyClass is Public and creatable. Then, you should be able to put the declaration in the "Declarations" section of a code module (NOT an object module like a class or ThisWorkbook), outside of and before any proc in that module. -- Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2008 Pearson Software Consulting, LLC www.cpearson.com (email on web site) "OfficeUser" wrote in message ... I have an .ocx file named MyProject. It contains a class named MyClass which contains two VBA functions. MyProject is referenced in Tools-References. Where do I put this line of code: Public oMyClass As New MyProject.MyClass so the following occurs: Anywhere in your Code you should now be able (supported by intellisense), to type oMyClass. .... and as soon as you type that, your list of functions inside MyClass should pop up and be usable inside VBA. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It is the Instancing property (accessible in the Properties window of VB) of
the class. The property can be Private, PublicNotCreatable, MultiUse or Global MultiUse. You want to make sure that it is not Private or PublicNotCreatable. -- Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2008 Pearson Software Consulting, LLC www.cpearson.com (email on web site) "OfficeUser" wrote in message ... Thanks for responding, Chip! What do you mean by "Make sure that MyClass is Public and creatable"? How do I do that? Thanks! "Chip Pearson" wrote in message ... Make sure that MyClass is Public and creatable. Then, you should be able to put the declaration in the "Declarations" section of a code module (NOT an object module like a class or ThisWorkbook), outside of and before any proc in that module. -- Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2008 Pearson Software Consulting, LLC www.cpearson.com (email on web site) "OfficeUser" wrote in message ... I have an .ocx file named MyProject. It contains a class named MyClass which contains two VBA functions. MyProject is referenced in Tools-References. Where do I put this line of code: Public oMyClass As New MyProject.MyClass so the following occurs: Anywhere in your Code you should now be able (supported by intellisense), to type oMyClass. .... and as soon as you type that, your list of functions inside MyClass should pop up and be usable inside VBA. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, Chip!
BTW, I read a lot of the threads here and see you responding to a goodly number if questions. You are always very courteous and professional. I like how you end all your responses with "Cordially"!! Thanks for all the time you put into this newsgroup. "Chip Pearson" wrote in message ... It is the Instancing property (accessible in the Properties window of VB) of the class. The property can be Private, PublicNotCreatable, MultiUse or Global MultiUse. You want to make sure that it is not Private or PublicNotCreatable. -- Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2008 Pearson Software Consulting, LLC www.cpearson.com (email on web site) "OfficeUser" wrote in message ... Thanks for responding, Chip! What do you mean by "Make sure that MyClass is Public and creatable"? How do I do that? Thanks! "Chip Pearson" wrote in message ... Make sure that MyClass is Public and creatable. Then, you should be able to put the declaration in the "Declarations" section of a code module (NOT an object module like a class or ThisWorkbook), outside of and before any proc in that module. -- Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2008 Pearson Software Consulting, LLC www.cpearson.com (email on web site) "OfficeUser" wrote in message ... I have an .ocx file named MyProject. It contains a class named MyClass which contains two VBA functions. MyProject is referenced in Tools-References. Where do I put this line of code: Public oMyClass As New MyProject.MyClass so the following occurs: Anywhere in your Code you should now be able (supported by intellisense), to type oMyClass. .... and as soon as you type that, your list of functions inside MyClass should pop up and be usable inside VBA. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Public is not Public | Excel Programming | |||
Use of PUBLIC | Excel Programming | |||
Dim vs. Public | Excel Programming | |||
public sub | Excel Programming | |||
Public Sub Help | Excel Programming |