Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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
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
How to save a workbook to an active Web Page? Nadia Excel Discussion (Misc queries) 0 May 2nd 08 06:23 PM
Save active sheet into new workbook MarkN Excel Programming 3 August 22nd 07 09:00 PM
VB Method to copy and save only one sheet of the active workbook Rock* Excel Programming 2 March 9th 06 12:33 AM
How save active workbook w/o knowing name John Excel Programming 3 January 20th 06 12:16 AM
Macro: Exit active workbook without save? Don Excel Worksheet Functions 0 May 20th 05 06:47 AM


All times are GMT +1. The time now is 11:08 PM.

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

About Us

"It's about Microsoft Excel"