Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
i am learning Class Module now, could someone tell me what's the different between the following: Public WithEvents OptionGroup As OptionButton and Public WithEvents OptionGroup As MSForms.OptionButton ie, with and without the MSFOrms??? In addition, could someone please let me know where I can find more info on Class Modules? Thanks Augustus |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Augustus,
what's the different between the following: Public WithEvents OptionGroup As OptionButton and Public WithEvents OptionGroup As MSForms.OptionButton There is no difference, the point is that you have a closer definition for OptionButton if you write MSForms.OptionButton because herewith you give the connection that OptionButton is a part of the Forms system within Excel. That could be helpful for a correct definition for Excel in some cases... If you do not exactly know where your data type is included, use the Object Browser (use F2 within the VBA Editor) and search for the data type... then you can find out where it is defined within excel. Best Markus ie, with and without the MSFOrms??? In addition, could someone please let me know where I can find more info on Class Modules? Thanks Augustus . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Markus Scheible" wrote in message
... what's the different between the following: Public WithEvents OptionGroup As OptionButton and Public WithEvents OptionGroup As MSForms.OptionButton There is no difference, the point is that you have a closer definition for OptionButton if you write MSForms.OptionButton because herewith you give the connection that OptionButton is a part of the Forms system within Excel. That could be helpful for a correct definition for Excel in some cases... If you do not exactly know where your data type is included, use the Object Browser (use F2 within the VBA Editor) and search for the data type... then you can find out where it is defined within excel. Hi Markus, Actually, in the context of a WithEvents class module it's critical that you prefix the OptionButton object name with the MSForms type library. This is because there is a hidden object with the name OptionButton in the Excel type library (right-click in the Object Browser and choose Show Hidden Members). Because the Excel type library always comes before the MSForms type library in the Tools/References list, if you only specify OptionButton VBA will always resolve it as the Excel object rather than the MSForms object. Since the Excel object doesn't support events, the code will fail. -- Rob Bovey, Excel MVP Application Professionals http://www.appspro.com/ * Take your Excel development skills to the next level. * Professional Excel Development http://www.appspro.com/Books/Books.htm |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Characters Qualifying a formula | Excel Discussion (Misc queries) | |||
Qualifying sub names | Excel Programming | |||
Missing Nav Links in VBA & MSFORMS Help | Excel Programming | |||
On Enter and On Exit events of MSFORMS controls? | Excel Programming | |||
MSForms cancel | Excel Programming |