PDA

View Full Version : Right click



thair younis
04-30-2012, 02:04 PM
Hi
In my Excel right click not working
What should i do
Thank you

Aussiebear
04-30-2012, 03:25 PM
Does the right click work in other software?

thair younis
04-30-2012, 03:49 PM
yeah work in word and other program , but except in excel not work

thair younis
05-05-2012, 06:04 AM
Hi
No suggestion

Aussiebear
05-05-2012, 06:19 AM
Try the following in a new workbook and see if it works.

Sub Enable_All_Right_Click_Menus()
'This will enable all BuiltIn Command bars
Dim Cbar As CommandBar
For Each Cbar In Application.CommandBars
Cbar.Enabled = True
Next
End Sub


Place in the This Workbook module and let us know the result

thair younis
05-05-2012, 06:25 AM
Hi Aussiebear
I will try it , and reply you
Thank you

thair younis
05-05-2012, 06:26 AM
yes it's working

thair younis
05-05-2012, 06:29 AM
but should I always use this code when i use excel
I want know what's the problem
and why I can't use right click without code

Aussiebear
05-05-2012, 05:36 PM
Not sure. For some reason Excel's command bars are not being read correctly on loading, hence the loss of the right click function. I was hoping that someone with more experience could assist here.

Aussiebear
05-05-2012, 05:37 PM
Are you saying that the error still occurs in the existing workbooks?

shrivallabha
05-06-2012, 01:53 AM
but should I always use this code when i use excel
I want know what's the problem
and why I can't use right click without code
It will happen when you have some other code which wants to "disable" right click for some reason. Check the codes that you run regularly, one of them will be having a code which will be opposite of what Aussiebear has provided.
Cbar.Enabled = "False"

And the commandbar would be:
Application.CommandBars("Cell")

Look for these and let us know.

thair younis
05-06-2012, 03:45 AM
Are you saying that the error still occurs in the existing workbooks?

Hi Aussiebear
yeah the error still in my Excel

thair younis
05-06-2012, 03:59 AM
It will happen when you have some other code which wants to "disable" right click for some reason. Check the codes that you run regularly, one of them will be having a code which will be opposite of what Aussiebear has provided.
Cbar.Enabled = "False"
Hi shrivallabha
This part from (Aussiebear) works well


And the commandbar would be:
Application.CommandBars("Cell")
But this line , when I put it in the code , give me error


Look for these and let us know.

shrivallabha
05-07-2012, 06:14 AM
Hi thair,

What I meant to say is:

1. Do you run some more macros other than the one posted by aussiebear above?
If yes, then search up those macros if they are disabling right-click completely.

2. What I have given is a sort of keyword for searching i.e. search criterion.

3. If you find such code then you will come to know about the reason why your right click doesn't work.

I hope this helps you.

thair younis
05-07-2012, 09:58 AM
What I meant to say is:

1. Do you run some more macros other than the one posted by aussiebear above?
If yes, then search up those macros if they are disabling right-click completely.


Hi shrivallabha

I just run his aussiebear code not any other code

Thank you for replied me

Aussiebear
05-07-2012, 03:00 PM
Have a look in the last couple of Excel files you were using before the right click function failed. As Shrivallabha has been quietly suggesting, there might well be some code in there that changes the right click function. This is something that you need to do as we do not have access to your files. If you find something or think you've found something, please feel free to post it.

thair younis
05-08-2012, 04:04 AM
Hi Aussiebear
Ok i will
thank you