Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Changing RightClick event handling


Hi,

I have a basic macro that is called from the right click event, which
disables the normal right click function and writes the text in the
right clicked cell out to a text file. I was hoping to build a user
button that would toggle between this mode and regular right click mode
while operating in the worksheet without having to go into the worksheet
code and change it, so I can go back and forth without going to the
editor. Is this possible?


Thanks,


--
GeyserPeak
------------------------------------------------------------------------
GeyserPeak's Profile: http://www.excelforum.com/member.php...o&userid=20746
View this thread: http://www.excelforum.com/showthread...hreadid=390439

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Changing RightClick event handling

How about just adding it to the bottom of that rightclick menu. Then they can
choose what they want.

This kind of thing might help:

Option Explicit
Sub auto_open()
With Application.CommandBars("cell")
On Error Resume Next
.Controls("DumpToFile").Delete
On Error GoTo 0

With .Controls.Add(Type:=msoControlButton, temporary:=True)
.BeginGroup = True
.Caption = "DumpToFile"
.OnAction = ThisWorkbook.Name & "!yourmacronamehere"
End With
End With
End Sub
Sub auto_close()
With Application.CommandBars("cell")
On Error Resume Next
.Controls("DumpToFile").Delete
On Error GoTo 0
End With
End Sub
Sub yourmacronamehere()
MsgBox "hi from your macro!"
End Sub


You could add some code into your macro that verifies that you're on the correct
worksheet of the correct workbook (or not!).



GeyserPeak wrote:

Hi,

I have a basic macro that is called from the right click event, which
disables the normal right click function and writes the text in the
right clicked cell out to a text file. I was hoping to build a user
button that would toggle between this mode and regular right click mode
while operating in the worksheet without having to go into the worksheet
code and change it, so I can go back and forth without going to the
editor. Is this possible?

Thanks,

--
GeyserPeak
------------------------------------------------------------------------
GeyserPeak's Profile: http://www.excelforum.com/member.php...o&userid=20746
View this thread: http://www.excelforum.com/showthread...hreadid=390439


--

Dave Peterson
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
checkbox event handling function nevwalters Excel Worksheet Functions 2 May 16th 06 04:27 AM
Before RightClick event change broogle Excel Programming 6 June 30th 05 03:57 AM
Event handling... Alex Excel Programming 1 January 29th 05 06:24 PM
Handling of event raised in other class module VbaNew Excel Programming 1 January 10th 05 12:42 PM
excel object event handling Vladimir Kryachko Excel Programming 1 September 9th 04 08:01 AM


All times are GMT +1. The time now is 07:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"