Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 167
Default Strange RefEdit Problem

I have been having issues using RefEdit controls and events, and I have
narrowed the problem down to how the user uses the control. That is, if
RefEdit1 has focus and the user clicks in the text box area of the control
and then selects cells in the background, everything is fine. All events
work correctly, and the userform works as planned.

However, if the user clicks on the RefEdit's button (the one with a
horizontal line that when clicked collapses the form), the user is allowed to
select cells and return to the form, but when the events attempt to run, the
userform crashes. Excel crashes soon thereafter.

I am using enter, exit, and change events with the RefEdit control. I have
tried cleaning the code with Rob Bovey's cleaner. Removing all RefEdit
events seemed to work, but the userform doesn't function as I want it to.

Does anyone have an explanation for this? Is there a way to limit the
RefEdit control to not allow users to click on the collapse button?

Thanks,
Pflugs
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Strange RefEdit Problem

Is it in a frame? I have had odd problems with RefEdit in a frame, but
removing them usually gets rid of the problem.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Pflugs" wrote in message
...
I have been having issues using RefEdit controls and events, and I have
narrowed the problem down to how the user uses the control. That is, if
RefEdit1 has focus and the user clicks in the text box area of the control
and then selects cells in the background, everything is fine. All events
work correctly, and the userform works as planned.

However, if the user clicks on the RefEdit's button (the one with a
horizontal line that when clicked collapses the form), the user is allowed
to
select cells and return to the form, but when the events attempt to run,
the
userform crashes. Excel crashes soon thereafter.

I am using enter, exit, and change events with the RefEdit control. I
have
tried cleaning the code with Rob Bovey's cleaner. Removing all RefEdit
events seemed to work, but the userform doesn't function as I want it to.

Does anyone have an explanation for this? Is there a way to limit the
RefEdit control to not allow users to click on the collapse button?

Thanks,
Pflugs



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Strange RefEdit Problem


Jon Peltier's advice/answer to your almost identical post of 06/27/2007
would be worth reading again.
I would add - never set the focus to a RefEdit control and
do not add a RefEdit control to a Frame.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Pflugs"
wrote in message
I have been having issues using RefEdit controls and events, and I have
narrowed the problem down to how the user uses the control. That is, if
RefEdit1 has focus and the user clicks in the text box area of the control
and then selects cells in the background, everything is fine. All events
work correctly, and the userform works as planned.

However, if the user clicks on the RefEdit's button (the one with a
horizontal line that when clicked collapses the form), the user is allowed to
select cells and return to the form, but when the events attempt to run, the
userform crashes. Excel crashes soon thereafter.

I am using enter, exit, and change events with the RefEdit control. I have
tried cleaning the code with Rob Bovey's cleaner. Removing all RefEdit
events seemed to work, but the userform doesn't function as I want it to.

Does anyone have an explanation for this? Is there a way to limit the
RefEdit control to not allow users to click on the collapse button?

Thanks,
Pflugs
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 167
Default Strange RefEdit Problem

I had not seen Jon's post since 6/30 was my wedding day. I apologize.

The two RefEdit controls were in frames. I have since removed the frames,
but I still had problems with the RefEdit events. I removed all set focus
commands relating to the RefEdits, and I'm trying to write other events
instead of a RefEdit_Change event.

Are there any problems with using Enter/Exit/Change events with other
controls, especially textboxes?

Thanks,
Pflugs

"Jim Cone" wrote:


Jon Peltier's advice/answer to your almost identical post of 06/27/2007
would be worth reading again.
I would add - never set the focus to a RefEdit control and
do not add a RefEdit control to a Frame.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Pflugs"
wrote in message
I have been having issues using RefEdit controls and events, and I have
narrowed the problem down to how the user uses the control. That is, if
RefEdit1 has focus and the user clicks in the text box area of the control
and then selects cells in the background, everything is fine. All events
work correctly, and the userform works as planned.

However, if the user clicks on the RefEdit's button (the one with a
horizontal line that when clicked collapses the form), the user is allowed to
select cells and return to the form, but when the events attempt to run, the
userform crashes. Excel crashes soon thereafter.

I am using enter, exit, and change events with the RefEdit control. I have
tried cleaning the code with Rob Bovey's cleaner. Removing all RefEdit
events seemed to work, but the userform doesn't function as I want it to.

Does anyone have an explanation for this? Is there a way to limit the
RefEdit control to not allow users to click on the collapse button?

Thanks,
Pflugs

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Strange RefEdit Problem


Well, getting married does seem to rid ones' mind of other issues. <g
Best of luck to you.

I know of no other Office controls that create problems similar to the
RefEdit control.
I have found that the interaction between code and controls is sometimes
not as I visualize it. It can be revealing to step thru the code one line at a time.

Oh, and it is best to avoid the marriage exit event. <g
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Pflugs"
wrote in message
I had not seen Jon's post since 6/30 was my wedding day. I apologize.

The two RefEdit controls were in frames. I have since removed the frames,
but I still had problems with the RefEdit events. I removed all set focus
commands relating to the RefEdits, and I'm trying to write other events
instead of a RefEdit_Change event.

Are there any problems with using Enter/Exit/Change events with other
controls, especially textboxes?
Thanks,
Pflugs

"Jim Cone" wrote:
Jon Peltier's advice/answer to your almost identical post of 06/27/2007
would be worth reading again.
I would add - never set the focus to a RefEdit control and
do not add a RefEdit control to a Frame.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware




"Pflugs"
wrote in message
I have been having issues using RefEdit controls and events, and I have
narrowed the problem down to how the user uses the control. That is, if
RefEdit1 has focus and the user clicks in the text box area of the control
and then selects cells in the background, everything is fine. All events
work correctly, and the userform works as planned.

However, if the user clicks on the RefEdit's button (the one with a
horizontal line that when clicked collapses the form), the user is allowed to
select cells and return to the form, but when the events attempt to run, the
userform crashes. Excel crashes soon thereafter.

I am using enter, exit, and change events with the RefEdit control. I have
tried cleaning the code with Rob Bovey's cleaner. Removing all RefEdit
events seemed to work, but the userform doesn't function as I want it to.

Does anyone have an explanation for this? Is there a way to limit the
RefEdit control to not allow users to click on the collapse button?

Thanks,
Pflugs



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 167
Default Strange RefEdit Problem

Thanks for the well wishes and the advice to avoid the marriage_Exit event!
That's pretty clever...

Anyway, the problem I've been having is that RefEdit code refuses to let me
step through it. It will crash even with breakpoints and stop commands. Any
event that even references the RefEdit seems to be susceptible to this
behavior, even Userform events. That makes it awfully hard to code and
debug!

I guess the best thing to do would be to write procedures called by command
buttons instead of events, but that assumes extra intelligence by the user.
Stupid controls...

Thanks,
Pflugs

"Jim Cone" wrote:


Well, getting married does seem to rid ones' mind of other issues. <g
Best of luck to you.

I know of no other Office controls that create problems similar to the
RefEdit control.
I have found that the interaction between code and controls is sometimes
not as I visualize it. It can be revealing to step thru the code one line at a time.

Oh, and it is best to avoid the marriage exit event. <g
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Pflugs"
wrote in message
I had not seen Jon's post since 6/30 was my wedding day. I apologize.

The two RefEdit controls were in frames. I have since removed the frames,
but I still had problems with the RefEdit events. I removed all set focus
commands relating to the RefEdits, and I'm trying to write other events
instead of a RefEdit_Change event.

Are there any problems with using Enter/Exit/Change events with other
controls, especially textboxes?
Thanks,
Pflugs

"Jim Cone" wrote:
Jon Peltier's advice/answer to your almost identical post of 06/27/2007
would be worth reading again.
I would add - never set the focus to a RefEdit control and
do not add a RefEdit control to a Frame.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware




"Pflugs"
wrote in message
I have been having issues using RefEdit controls and events, and I have
narrowed the problem down to how the user uses the control. That is, if
RefEdit1 has focus and the user clicks in the text box area of the control
and then selects cells in the background, everything is fine. All events
work correctly, and the userform works as planned.

However, if the user clicks on the RefEdit's button (the one with a
horizontal line that when clicked collapses the form), the user is allowed to
select cells and return to the form, but when the events attempt to run, the
userform crashes. Excel crashes soon thereafter.

I am using enter, exit, and change events with the RefEdit control. I have
tried cleaning the code with Rob Bovey's cleaner. Removing all RefEdit
events seemed to work, but the userform doesn't function as I want it to.

Does anyone have an explanation for this? Is there a way to limit the
RefEdit control to not allow users to click on the collapse button?

Thanks,
Pflugs


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Strange RefEdit Problem


I've had that refuse to cooperate and crash problem.
You may have an extra control or two on the form you don't know about.
Check the Form properties window and see if there are any controls
listed you aren't using. Also, select any remaining frames and check for
duplicate controls on them. (or duplicate frames)
The RefEdit control can duplicate itself gratuitously and copies of other controls
can show up just by touching that Ctrl key sometimes.

If all fails...
(1) You could start over with a new form
(2) Use a work around by replacing the RefEdit with an InputBox.
My "Shade Data Rows" add-in on the Products page at my website
uses that technique. It has a picture of a RefEdit control that when clicked
shows an InputBox. Not for all occasions, but if you are really ****ed...
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Pflugs"
wrote in message
Thanks for the well wishes and the advice to avoid the marriage_Exit event!
That's pretty clever...

Anyway, the problem I've been having is that RefEdit code refuses to let me
step through it. It will crash even with breakpoints and stop commands. Any
event that even references the RefEdit seems to be susceptible to this
behavior, even Userform events. That makes it awfully hard to code and
debug!

I guess the best thing to do would be to write procedures called by command
buttons instead of events, but that assumes extra intelligence by the user.
Stupid controls...

Thanks,
Pflugs

"Jim Cone" wrote:

Well, getting married does seem to rid ones' mind of other issues. <g
Best of luck to you.

I know of no other Office controls that create problems similar to the
RefEdit control.
I have found that the interaction between code and controls is sometimes
not as I visualize it. It can be revealing to step thru the code one line at a time.

Oh, and it is best to avoid the marriage exit event. <g
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Pflugs"
wrote in message
I had not seen Jon's post since 6/30 was my wedding day. I apologize.

The two RefEdit controls were in frames. I have since removed the frames,
but I still had problems with the RefEdit events. I removed all set focus
commands relating to the RefEdits, and I'm trying to write other events
instead of a RefEdit_Change event.

Are there any problems with using Enter/Exit/Change events with other
controls, especially textboxes?
Thanks,
Pflugs

"Jim Cone" wrote:
Jon Peltier's advice/answer to your almost identical post of 06/27/2007
would be worth reading again.
I would add - never set the focus to a RefEdit control and
do not add a RefEdit control to a Frame.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware




"Pflugs"
wrote in message
I have been having issues using RefEdit controls and events, and I have
narrowed the problem down to how the user uses the control. That is, if
RefEdit1 has focus and the user clicks in the text box area of the control
and then selects cells in the background, everything is fine. All events
work correctly, and the userform works as planned.

However, if the user clicks on the RefEdit's button (the one with a
horizontal line that when clicked collapses the form), the user is allowed to
select cells and return to the form, but when the events attempt to run, the
userform crashes. Excel crashes soon thereafter.

I am using enter, exit, and change events with the RefEdit control. I have
tried cleaning the code with Rob Bovey's cleaner. Removing all RefEdit
events seemed to work, but the userform doesn't function as I want it to.

Does anyone have an explanation for this? Is there a way to limit the
RefEdit control to not allow users to click on the collapse button?

Thanks,
Pflugs


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Strange RefEdit Problem

The RefEdit is a very important control but has all sorts of
limitations.

Also, I avoid using events with various text/combobox/refedit-type
controls preferring to wait until the user clicks the userform's OK
button before validating various user choices. You might want to check
Userform design
http://www.tushar-mehta.com/publish_...rinterface.htm

For my take on the RefEdit control see the sections starting with 'Range
references in a userform'

In article ,
says...
I had not seen Jon's post since 6/30 was my wedding day. I apologize.

The two RefEdit controls were in frames. I have since removed the frames,
but I still had problems with the RefEdit events. I removed all set focus
commands relating to the RefEdits, and I'm trying to write other events
instead of a RefEdit_Change event.

Are there any problems with using Enter/Exit/Change events with other
controls, especially textboxes?

Thanks,
Pflugs

"Jim Cone" wrote:


Jon Peltier's advice/answer to your almost identical post of 06/27/2007
would be worth reading again.
I would add - never set the focus to a RefEdit control and
do not add a RefEdit control to a Frame.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Pflugs"
wrote in message
I have been having issues using RefEdit controls and events, and I have
narrowed the problem down to how the user uses the control. That is, if
RefEdit1 has focus and the user clicks in the text box area of the control
and then selects cells in the background, everything is fine. All events
work correctly, and the userform works as planned.

However, if the user clicks on the RefEdit's button (the one with a
horizontal line that when clicked collapses the form), the user is allowed to
select cells and return to the form, but when the events attempt to run, the
userform crashes. Excel crashes soon thereafter.

I am using enter, exit, and change events with the RefEdit control. I have
tried cleaning the code with Rob Bovey's cleaner. Removing all RefEdit
events seemed to work, but the userform doesn't function as I want it to.

Does anyone have an explanation for this? Is there a way to limit the
RefEdit control to not allow users to click on the collapse button?

Thanks,
Pflugs


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 167
Default Strange RefEdit Problem

Thanks for the reference. I appreciate all the ideas I can get.

By the way, what are the four additional controls you show in your UserForm
toolbox? I recognize the Date and Time Picker, but the three in the bottom
right are unfamiliar to me. Could you tell me what they are and what they
do?

Thanks,
Pflugs

"Tushar Mehta" wrote:

The RefEdit is a very important control but has all sorts of
limitations.

Also, I avoid using events with various text/combobox/refedit-type
controls preferring to wait until the user clicks the userform's OK
button before validating various user choices. You might want to check
Userform design
http://www.tushar-mehta.com/publish_...rinterface.htm

For my take on the RefEdit control see the sections starting with 'Range
references in a userform'

In article ,
says...
I had not seen Jon's post since 6/30 was my wedding day. I apologize.

The two RefEdit controls were in frames. I have since removed the frames,
but I still had problems with the RefEdit events. I removed all set focus
commands relating to the RefEdits, and I'm trying to write other events
instead of a RefEdit_Change event.

Are there any problems with using Enter/Exit/Change events with other
controls, especially textboxes?

Thanks,
Pflugs

"Jim Cone" wrote:


Jon Peltier's advice/answer to your almost identical post of 06/27/2007
would be worth reading again.
I would add - never set the focus to a RefEdit control and
do not add a RefEdit control to a Frame.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Pflugs"
wrote in message
I have been having issues using RefEdit controls and events, and I have
narrowed the problem down to how the user uses the control. That is, if
RefEdit1 has focus and the user clicks in the text box area of the control
and then selects cells in the background, everything is fine. All events
work correctly, and the userform works as planned.

However, if the user clicks on the RefEdit's button (the one with a
horizontal line that when clicked collapses the form), the user is allowed to
select cells and return to the form, but when the events attempt to run, the
userform crashes. Excel crashes soon thereafter.

I am using enter, exit, and change events with the RefEdit control. I have
tried cleaning the code with Rob Bovey's cleaner. Removing all RefEdit
events seemed to work, but the userform doesn't function as I want it to.

Does anyone have an explanation for this? Is there a way to limit the
RefEdit control to not allow users to click on the collapse button?

Thanks,
Pflugs



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Strange RefEdit Problem

Don't know what the 1st one is; the last 2 are web browser and treeview
respectively. I often add controls on a temporary / experimental basis
and then remove them when I no longer need them.

In article ,
says...
Thanks for the reference. I appreciate all the ideas I can get.

By the way, what are the four additional controls you show in your UserForm
toolbox? I recognize the Date and Time Picker, but the three in the bottom
right are unfamiliar to me. Could you tell me what they are and what they
do?

Thanks,
Pflugs

"Tushar Mehta" wrote:

The RefEdit is a very important control but has all sorts of
limitations.

Also, I avoid using events with various text/combobox/refedit-type
controls preferring to wait until the user clicks the userform's OK
button before validating various user choices. You might want to check
Userform design
http://www.tushar-mehta.com/publish_...rinterface.htm

For my take on the RefEdit control see the sections starting with 'Range
references in a userform'

In article ,
says...
I had not seen Jon's post since 6/30 was my wedding day. I apologize.

The two RefEdit controls were in frames. I have since removed the frames,
but I still had problems with the RefEdit events. I removed all set focus
commands relating to the RefEdits, and I'm trying to write other events
instead of a RefEdit_Change event.

Are there any problems with using Enter/Exit/Change events with other
controls, especially textboxes?

Thanks,
Pflugs

"Jim Cone" wrote:


Jon Peltier's advice/answer to your almost identical post of 06/27/2007
would be worth reading again.
I would add - never set the focus to a RefEdit control and
do not add a RefEdit control to a Frame.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Pflugs"
wrote in message
I have been having issues using RefEdit controls and events, and I have
narrowed the problem down to how the user uses the control. That is, if
RefEdit1 has focus and the user clicks in the text box area of the control
and then selects cells in the background, everything is fine. All events
work correctly, and the userform works as planned.

However, if the user clicks on the RefEdit's button (the one with a
horizontal line that when clicked collapses the form), the user is allowed to
select cells and return to the form, but when the events attempt to run, the
userform crashes. Excel crashes soon thereafter.

I am using enter, exit, and change events with the RefEdit control. I have
tried cleaning the code with Rob Bovey's cleaner. Removing all RefEdit
events seemed to work, but the userform doesn't function as I want it to.

Does anyone have an explanation for this? Is there a way to limit the
RefEdit control to not allow users to click on the collapse button?

Thanks,
Pflugs






  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Strange RefEdit Problem

As an alternative, you could use Application.InputBox, with Type=8, in a
suitable event.
Add error handling to the code below:

Private Sub CommandButton1_Click()
Dim RetVal As Variant

Const RANGE_ONLY As Long = 8

Set RetVal = Application.InputBox("Select a range", , , , , , , RANGE_ONLY)

TextBox1.Text = RetVal.Address

End Sub

NickHK

"Pflugs" wrote in message
...
I have been having issues using RefEdit controls and events, and I have
narrowed the problem down to how the user uses the control. That is, if
RefEdit1 has focus and the user clicks in the text box area of the control
and then selects cells in the background, everything is fine. All events
work correctly, and the userform works as planned.

However, if the user clicks on the RefEdit's button (the one with a
horizontal line that when clicked collapses the form), the user is allowed

to
select cells and return to the form, but when the events attempt to run,

the
userform crashes. Excel crashes soon thereafter.

I am using enter, exit, and change events with the RefEdit control. I

have
tried cleaning the code with Rob Bovey's cleaner. Removing all RefEdit
events seemed to work, but the userform doesn't function as I want it to.

Does anyone have an explanation for this? Is there a way to limit the
RefEdit control to not allow users to click on the collapse button?

Thanks,
Pflugs



  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 167
Default Strange RefEdit Problem

Now, that is a great solution. I really like that method. I will probably
use that all the time now. I like to use pages and frames to organize my
userforms, but there are often cases that I need range references. This will
work well. Thank you for showing it to me.

"NickHK" wrote:

As an alternative, you could use Application.InputBox, with Type=8, in a
suitable event.
Add error handling to the code below:

Private Sub CommandButton1_Click()
Dim RetVal As Variant

Const RANGE_ONLY As Long = 8

Set RetVal = Application.InputBox("Select a range", , , , , , , RANGE_ONLY)

TextBox1.Text = RetVal.Address

End Sub

NickHK

"Pflugs" wrote in message
...
I have been having issues using RefEdit controls and events, and I have
narrowed the problem down to how the user uses the control. That is, if
RefEdit1 has focus and the user clicks in the text box area of the control
and then selects cells in the background, everything is fine. All events
work correctly, and the userform works as planned.

However, if the user clicks on the RefEdit's button (the one with a
horizontal line that when clicked collapses the form), the user is allowed

to
select cells and return to the form, but when the events attempt to run,

the
userform crashes. Excel crashes soon thereafter.

I am using enter, exit, and change events with the RefEdit control. I

have
tried cleaning the code with Rob Bovey's cleaner. Removing all RefEdit
events seemed to work, but the userform doesn't function as I want it to.

Does anyone have an explanation for this? Is there a way to limit the
RefEdit control to not allow users to click on the collapse button?

Thanks,
Pflugs




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
Refedit copy paste problem? T.c.Goosen1977[_53_] Excel Programming 3 July 10th 06 11:58 AM
Refedit copy paste problem? T.c.Goosen1977[_51_] Excel Programming 0 July 10th 06 09:55 AM
Refedit copy paste problem? T.c.Goosen1977[_52_] Excel Programming 0 July 10th 06 09:55 AM
RefEdit in Class Module Problem Mark Driscol[_2_] Excel Programming 6 June 27th 06 04:29 PM
RefEdit problem: z-order of forms change [email protected] Excel Programming 0 June 27th 06 07:28 AM


All times are GMT +1. The time now is 11:20 AM.

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"