Sourcing RefEdit events

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
24,208
If I want a variable to source events from a userform's textbox, I would use
Code:
 Public myTextBox as msForms.TextBox
.

What class would I use to source events from a RefEdit control?

There is no msForms.RefEdit class.

Thanks.

(Yes, I know they are buggy as all get out. :) )
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

MarcelBeug

Well-known Member
Joined
Apr 25, 2014
Messages
1,811
This works with me:
Code:
Sub testRefEdit()

Dim myRefEdit As RefEdit.RefEdit

Set myRefEdit = UserForm1.RefEdit1


End Sub
 

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
24,208
I get a "User defined type not defined" error.
I guess my Mac (Excel 2011) doesn't have the RefEdit library. (2004 did).
 

MarcelBeug

Well-known Member
Joined
Apr 25, 2014
Messages
1,811
My Windows 8.1 laptop has, i.e. once I create a userform with a RefEdit control, I have RefEdit in my Object Browser, refering to:
C:\Program Files\Microsoft Office 15\Root\Office15\REFEDIT.DLL
 

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
24,208
Does that source events?
If you put Public WithEvents myRE as RefEdit.RefEdit in a Class Module, does the drop down give you the option for myRE events?
 

MarcelBeug

Well-known Member
Joined
Apr 25, 2014
Messages
1,811
Does that source events?
If you put Public WithEvents myRE as RefEdit.RefEdit in a Class Module, does the drop down give you the option for myRE events?
It does, but first after adding the reference "RefEdit Control", either via Tools - References or by creating a form with a RefEdit control.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,878
Messages
5,834,205
Members
430,263
Latest member
abz54

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top