auto save when form is closed
Try this
Option Explicit
Private Const fPath As String = "I:\work\Engineering Data\Product
Data\Meters\Turbine Meters\"
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
ThisWorkbook.SaveCopyAs (fPath & Chr(32) & TextBox26)
End Sub
"tpeter" wrote:
Jeff,
That worked great thank you. I subsituted ("4-4-08 Run 1") for ("textbox26")
and it did exaclty what I wanted. I still need to be able to put the path
into this location.I:\work\Engineering Data\Product Data\Meters\Turbine
Meters, I have tried putting it into the () and outside and I get an error.
Any idea's? Thank you again for your help.
"Jeff" wrote:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Application.Dialogs(xlDialogSaveAs).Show ("4-4-08 Run 1")
End Sub
"tpeter" wrote:
I have a userform that pops up when a file is open to make sure all of the
data goes into the correct place. I would like to add 1 more textbox that
would give the used the ability to type in the file name, an example would be
4-4-08 Run 1. When the form is closed I would like to have the file
automatically saved to a certian location with the file name added. An
example would be I/work/engineeringdata/productdata/meters/turbine/(file name
entered by user).xls. I could make a macro to run on the forms close to save
the file name but am unsure how to attache the userinfo to the path and name.
Thank you for your help.
Tim Peter
|