PDA

View Full Version : Chart Object Disable Right Click



Stu8866
03-26-2008, 06:27 AM
Hi There,

I have a worksheet with a chart object on it. I have some vba code which changes parts of the chart, at various different times.

THe problem is that i don't want the user to be able to change the charts' source data, or any other properties of the chart.

I can assign a macro to the onclick event of the chart obj, but the user is still able to right click. Is there any event to catch this?

I've tried the worksheet onrightclick event, which works find for cells, but not objects.

The other alternative to this, which i have tried, is unlocking the worksheet before the code is executed and then locking it again. Which does work OK but if the user is viewing another worksheet and calls the code, the worksheet.protect/unprotect lines of the code make the worksheet with the chart on it open for a brief second. In this particular project this can't happen...

Thanks,

tpoynton
03-26-2008, 06:56 AM
what about copying (cutting?) the chart and pasting as a picture? People would still be able to change things through the menus, so disabling the right click wouldnt be so effective.