View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
[email protected] Hendy88@gmail.com is offline
external usenet poster
 
Posts: 16
Default Private Textbox Exit Sub question...

Well to add to this... after what we talked about above is all said
and done... I then have a little "GIF Icon" they click where they can
actually save as [their Employee Number] to My Documents. The code I
have is this:

Private Sub SaveMYTIME_Click()
Dim FileName As String
Dim SaveFileTo As Variant

FileName = Range("C10").Value

SaveFileTo = Application.GetSaveAsFilename("C:\My Documents\" &
FileName, _
"Workbook (*.xls), *.xls", , "Save File As:")
End Sub


The [C10] Range is where the Textbox "dumps" their employee number
after they enter it. Here's the next question:

The "Save File As" Window comes up just fine, it automatically put
their Employee Number as the file name, and then has two buttons, Save
and Cancel, for them to proceed. I would like to know how to Close
the workbook IF they click Save, or return focus to the Workbook IF
they click Cancel out of that window.

How would I go about do that one since that window is an
Application.Window not a created form (if I said all that right)?

So I'm looking for something like:

SaveFileTo = Application.GetSaveAsFilename("C:\My Documents\" &
FileName, _
"Workbook (*.xls), *.xls", , "Save File As:")
If (Clicked Save) Then
ActiveWorkbook.Close
Else If (Clicked Cancel) Then
MyTIMEForm.SetFocus
End If