Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Windows key and keycode

I have a workbook that uses multiple userforms that users on the warehouse
floor enter information onto.

The problem I have is that users are crashing the workbook.

I've managed to disable the Break key as well as the Ctl-Alt-Delte combination

However the Windows key is a bit more of a challenge, I thought I could
capture the keystroke as follows:


Sub UserForm_KeyDown(ByVal keycode As MSForms.ReturnInteger, ByVal _
Shift As Integer)

'Capure the KeyStroke
If keycode = 92 Or keycode = 91 Then
' Throw away the Key Stroke
keycode = 0
MsgBox "Your Shouldn't be pressing the Windows Key!"

End If
End sub

But this doesn't stop the Start Window from showing.
In addition this only works for a userform without any controls, How would I
go about capturing these keystroke for all forms used without having to
copying or placing a call routine into all KeyDown procedures.

Any ideas, please help.......

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 230
Default Windows key and keycode

leerem wrote:
I have a workbook that uses multiple userforms that users on the warehouse
floor enter information onto.

The problem I have is that users are crashing the workbook.

I've managed to disable the Break key as well as the Ctl-Alt-Delte combination

However the Windows key is a bit more of a challenge, I thought I could
capture the keystroke as follows:


Sub UserForm_KeyDown(ByVal keycode As MSForms.ReturnInteger, ByVal _
Shift As Integer)

'Capure the KeyStroke
If keycode = 92 Or keycode = 91 Then
' Throw away the Key Stroke
keycode = 0
MsgBox "Your Shouldn't be pressing the Windows Key!"

End If
End sub

But this doesn't stop the Start Window from showing.


ITYM ByRef keycode since you are trying to alter the value returned.

I don't see why having the start window showing crashes your application.

Regards,
Martin Brown
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Windows key and keycode

Because,
Once the start menu is showing this allows the Users to shut down the PC

"Martin Brown" wrote:

leerem wrote:
I have a workbook that uses multiple userforms that users on the warehouse
floor enter information onto.

The problem I have is that users are crashing the workbook.

I've managed to disable the Break key as well as the Ctl-Alt-Delte combination

However the Windows key is a bit more of a challenge, I thought I could
capture the keystroke as follows:


Sub UserForm_KeyDown(ByVal keycode As MSForms.ReturnInteger, ByVal _
Shift As Integer)

'Capure the KeyStroke
If keycode = 92 Or keycode = 91 Then
' Throw away the Key Stroke
keycode = 0
MsgBox "Your Shouldn't be pressing the Windows Key!"

End If
End sub

But this doesn't stop the Start Window from showing.


ITYM ByRef keycode since you are trying to alter the value returned.

I don't see why having the start window showing crashes your application.

Regards,
Martin Brown
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Windows key and keycode


A couple of "out of the box" suggestions...
1. Save the data more often, so shutdowns don't cause data loss.
2. Ask the users why they are shutting the computer down and fix the "why" problem.
--
Jim Cone
Portland, Oregon USA




"leerem"
wrote in message ...
I have a workbook that uses multiple userforms that users on the warehouse
floor enter information onto.

The problem I have is that users are crashing the workbook.

I've managed to disable the Break key as well as the Ctl-Alt-Delte combination

However the Windows key is a bit more of a challenge, I thought I could
capture the keystroke as follows:


Sub UserForm_KeyDown(ByVal keycode As MSForms.ReturnInteger, ByVal _
Shift As Integer)

'Capure the KeyStroke
If keycode = 92 Or keycode = 91 Then
' Throw away the Key Stroke
keycode = 0
MsgBox "Your Shouldn't be pressing the Windows Key!"

End If
End sub

But this doesn't stop the Start Window from showing.
In addition this only works for a userform without any controls, How would I
go about capturing these keystroke for all forms used without having to
copying or placing a call routine into all KeyDown procedures.

Any ideas, please help.......

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 230
Default Windows key and keycode

leerem wrote:
Because,
Once the start menu is showing this allows the Users to shut down the PC


That should not crash the PC or lose data from the spreadsheet unless
they choose not to save changes (and you could alter that behaviour).

Regards,
Martin Brown

"Martin Brown" wrote:

leerem wrote:
I have a workbook that uses multiple userforms that users on the warehouse
floor enter information onto.

The problem I have is that users are crashing the workbook.

I've managed to disable the Break key as well as the Ctl-Alt-Delte combination

However the Windows key is a bit more of a challenge, I thought I could
capture the keystroke as follows:


Sub UserForm_KeyDown(ByVal keycode As MSForms.ReturnInteger, ByVal _
Shift As Integer)

'Capure the KeyStroke
If keycode = 92 Or keycode = 91 Then
' Throw away the Key Stroke
keycode = 0
MsgBox "Your Shouldn't be pressing the Windows Key!"

End If
End sub

But this doesn't stop the Start Window from showing.

ITYM ByRef keycode since you are trying to alter the value returned.

I don't see why having the start window showing crashes your application.

Regards,
Martin Brown
.

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
Keycode description creator Beeatrice Excel Discussion (Misc queries) 1 November 12th 09 02:08 AM
cannot open exel from windows xp in windows vista and visa versa lildiana New Users to Excel 4 February 25th 09 07:26 PM
KeyCode Francis Ang[_3_] Excel Programming 11 September 6th 06 07:48 AM
TextBox and KeyCode Darrin Henshaw Excel Programming 7 April 26th 05 06:57 PM
detecting keycode internationally charlie Excel Programming 0 December 20th 04 09:42 PM


All times are GMT +1. The time now is 02:15 AM.

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

About Us

"It's about Microsoft Excel"