Disable the Shift ket at startup


Posted by Binky on December 28, 2001 10:54 AM

I haven't done much programming in Excel so bear with me if this is an easy question.

I am using Excel 2000. I have 5 sales reps workbooks that each have 13 pages. (1 for each month and a totals page) The totals pages for each of these are linked to a master totals page.

I have some code that returns the logged in user's username (W2K) I have that code running in the Workbook_Open event. I have also figured out how to create a digital signature and assign it to my code to make it harder for the user to disable macros.

What I also need to find out is how to create an invisible button that will enable only me to toggle between the 'Shift' key being enabled or disabled. I have done this in Access but don't know how to do it in Excel.

Also I need to hide the worksheets upon startup to prevent unauthorized users from seeing data.

Any suggestions would be greatly appreciated. I am not looking for a freebie, I can't learn to do unless I do myself! But, some gentle nudging in the right direction would be appreciated!

Thanks in advance
Binky



Posted by Jacob on December 28, 2001 2:35 PM

Hi

To hide the worksheets do this

sub worksheet_open

application.enablecancelkey=xldisabled
activeworkbook.unprotect("Password")
sheets("Mysheet").visible = false
sheets("Myothersheet").visible = false
activeworkbook.protect("Password")
end sub


To disable the shift key check out (onkeys). If you are trying to disable the shift key before the workbook opens so the user cant use it to disable macros I think you are out of luck since the earliest it could trigger is with the open event.

Hope this helps

Jacob