Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Qualifying OptionButton with ro without MSForms

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default Qualifying OptionButton with ro without MSForms

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Qualifying OptionButton with ro without MSForms

"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
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
Characters Qualifying a formula Tevuna Excel Discussion (Misc queries) 3 August 25th 07 12:22 AM
Qualifying sub names Bura Tino Excel Programming 2 April 21st 04 02:30 PM
Missing Nav Links in VBA & MSFORMS Help John Rehmert Excel Programming 0 April 7th 04 05:35 PM
On Enter and On Exit events of MSFORMS controls? Haldun Alay[_3_] Excel Programming 1 November 4th 03 01:06 PM
MSForms cancel Tritan Excel Programming 1 July 17th 03 08:50 PM


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