PC Review


Reply
Thread Tools Rate Thread

BeforeDoubleClick

 
 
Stefi
Guest
Posts: n/a
 
      14th Dec 2007
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

 
Reply With Quote
 
 
 
 
Dave D-C
Guest
Posts: n/a
 
      18th Dec 2007
>.. 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?

Stefi <(E-Mail Removed)> wrote:
>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?



 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      18th Dec 2007
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.

Dave D-C wrote:
>
> >.. 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?
>
> Stefi <(E-Mail Removed)> wrote:
> >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?


--

Dave Peterson
 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      18th Dec 2007
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
 
Reply With Quote
 
Dave D-C
Guest
Posts: n/a
 
      18th Dec 2007
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

Dave Peterson <(E-Mail Removed)> wrote:
>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.


>Dave D-C wrote:
>> 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 ..
>> Can somebody address this (related) issue?


 
Reply With Quote
 
Stefi
Guest
Posts: n/a
 
      19th Dec 2007
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
>

 
Reply With Quote
 
Jim Rech
Guest
Posts: n/a
 
      19th Dec 2007
>>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
"Stefi" <(E-Mail Removed)> wrote in message
news:54A798AF-850E-4852-A112-(E-Mail Removed)...
| 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
| >


 
Reply With Quote
 
Stefi
Guest
Posts: n/a
 
      20th Dec 2007
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:

> >>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
> "Stefi" <(E-Mail Removed)> wrote in message
> news:54A798AF-850E-4852-A112-(E-Mail Removed)...
> | 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
> | >
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
BeforeDoubleClick Event not working Ayo Microsoft Excel Programming 2 10th Mar 2010 07:21 PM
BeforeDoubleClick code Ronbo Microsoft Excel Programming 3 27th Jan 2010 11:35 PM
Referring to BeforeDoubleClick art Microsoft Excel Programming 6 13th Oct 2008 03:46 AM
Help With BeforeDoubleClick jean Microsoft Excel Programming 3 19th Mar 2008 07:02 PM
beforedoubleclick and selectionchange =?Utf-8?B?Y2xhcmE=?= Microsoft Excel Programming 0 24th Apr 2007 06:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:01 AM.