Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hi Mr. Ogilvy how to Ctl+s to save workbook from Active UserForm
Hi all,
Somebody I wish to solve this ,,, Ia have a userform that interact with a WorBook, All I want now is to save that WorkBook from active UserForm by press Ctrl+s ... Somebody please help me... May be Mr. Tom Ogilvy the MVP can to this or someone else please ...! Thanks and Regards, Halim |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hi Mr. Ogilvy how to Ctl+s to save workbook from Active UserForm
Assume the useform is modal.
Maybe something like this code in the userform module Private Declare Function GetKeyState Lib "user32" _ (ByVal nVirtKey As Long) As Integer Const VK_CONTROL As Integer = &H11 'Ctrl Private Sub TextBox1_KeyDown(ByVal KeyCode _ As MSForms.ReturnInteger, ByVal Shift As Integer) Dim ctrl as Boolean If GetKeyState(VK_CONTROL) < 0 Then _ ctrl = True Else ctrl = False If KeyCode = 83 Then If ctrl Then KeyCode = 0 ThisWorkbook.Save End If End If End Sub You would need to use the KeyDown event of all controls on the Userform. -- Regards, Tom Ogilvy wrote in message oups.com... Hi all, Somebody I wish to solve this ,,, Ia have a userform that interact with a WorBook, All I want now is to save that WorkBook from active UserForm by press Ctrl+s ... Somebody please help me... May be Mr. Tom Ogilvy the MVP can to this or someone else please ...! Thanks and Regards, Halim |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hi Mr. Ogilvy how to Ctl+s to save workbook from Active UserForm
thank you very much for your quick reply ...
But unfortunately I can't always online because of my office rule that not allow pc client always online... but I'll try this. .. thanks againn ... Regards, Halim |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hi Mr. Ogilvy how to Ctl+s to save workbook from Active UserForm
Hi Mr. Ogilvy,
that's work ... I've tried the procedure keydown but there still a bug that "s" letter is occured and typed in the texbox that setfocus... I use sendkey "{BackSpace}" to clear "s" in the texbox ... Is there other way to do that ? thanks, Halim |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hi Mr. Ogilvy how to Ctl+s to save workbook from Active UserFo
I put in code I though would prevent that and it worked for me. The line
Keycode = 0 -- Regards, Tom Ogilvy " wrote: Hi Mr. Ogilvy, that's work ... I've tried the procedure keydown but there still a bug that "s" letter is occured and typed in the texbox that setfocus... I use sendkey "{BackSpace}" to clear "s" in the texbox ... Is there other way to do that ? thanks, Halim |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to save a workbook to an active Web Page? | Excel Discussion (Misc queries) | |||
Save active sheet into new workbook | Excel Programming | |||
VB Method to copy and save only one sheet of the active workbook | Excel Programming | |||
How save active workbook w/o knowing name | Excel Programming | |||
Macro: Exit active workbook without save? | Excel Worksheet Functions |