BeforeDoubleClick

  • Thread starter Thread starter Stefi
  • Start date Start date
S

Stefi

Hi All,

I have a
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
event procedure which worked well. I couldn't determine what happened, but
now it doesn't work, because Target is False and not a Range. What went wrong
and how could I fix it?

Thanks,
Stefi
 
.. because Target is False and not a Range.
This can't be right. (can it?)
Do: Msgbox Target.Address

But I have found out that doing a
Userform1.Show
in a BeforeDoubleClick routine will leave the doubleclicked
cell in 'Edit' or 'Enter' mode, which causes me problems.
It's as if EnableEvents becomes false, but I'm not setting it.

My workaround is to end the routine with
Sendkeys "{ESC}"
I am XL97/WIN98

My workaround seems hoky.
Can somebody address this (related) issue?
 
The event looks like:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _
Cancel As Boolean)

You can just use:

Cancel = true 'to stop from going into edit mode.

(same thing with the _beforerightclick event.
 
By chance did you create a variable named Target--a boolean variable on top of
that?
 
I used to think that "Thank you"s and "Your welcome"s were
just contributing noise and wasting bandwidth. But I was wrong.

Thank you. (and .. and .. and ..) Dave D-C
 
Hi Dave,

I definitely didn't do that. I'm afraid I came across an Excel bug, because
checking again my BeforeDoubleClick sub it seems to work again without
touching it in any way. As far as I know, users have no influence on
arguments of event routins (except in the way you supposed, but it's not the
case in my problem), they are internal affairs of Excel. The annoying thing
is that I can't determine the cause of this phenomenon thus I can't avoid
actions triggering this kind of behaviour.

Do you have any advice?

Thanks,
Stefi


„Dave Peterson†ezt írta:
 
I'm afraid I came across an Excel bug

It's always tempting to conclude that but most of the time it's not an Excel
bug, especially in a feature that's been around since Excel 97 and you're
the first to encounter it some 10 years later.

I'd love to see an reproducible example, and if you can send me one, you'll
have my abject apologies for ever doubting you.<g>

--
Jim
| Hi Dave,
|
| I definitely didn't do that. I'm afraid I came across an Excel bug,
because
| checking again my BeforeDoubleClick sub it seems to work again without
| touching it in any way. As far as I know, users have no influence on
| arguments of event routins (except in the way you supposed, but it's not
the
| case in my problem), they are internal affairs of Excel. The annoying
thing
| is that I can't determine the cause of this phenomenon thus I can't avoid
| actions triggering this kind of behaviour.
|
| Do you have any advice?
|
| Thanks,
| Stefi
|
|
| "Dave Peterson" ezt írta:
|
| > By chance did you create a variable named Target--a boolean variable on
top of
| > that?
| >
| > Stefi wrote:
| > >
| > > Hi All,
| > >
| > > I have a
| > > Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As
| > > Boolean)
| > > event procedure which worked well. I couldn't determine what happened,
but
| > > now it doesn't work, because Target is False and not a Range. What
went wrong
| > > and how could I fix it?
| > >
| > > Thanks,
| > > Stefi
| >
| > --
| >
| > Dave Peterson
| >
 
Hi Jim,

I thought of a bug because I didn't find any other explanation for the
phenomenon. Of course it's possible that I made a mistake or there was an
error in my computer's operation. My problem is that I can't reproduce the
error, it disappeared without any change in the code. I keep trying to
reproduce the error and I'll send a copy to you if I get a positive result.

Thanks and best regards,
Stefi



„Jim Rech†ezt írta:
 
Back
Top