Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Save As" box

Status
Not open for further replies.

dannabn

Programmer
Jun 12, 2003
5
US
I would like my users to avoid filling in the "save as" box in a vb app. How can I have the vb app pass the file name to the "save as" box and not even display it ???
 
If you don't want the user to fill anything in the "Save As" box, do you even need the "Save As" box to show?
Code:
ActiveWorkbook.SaveAs fPath & "\" & fName
Where "fPath" is a variable containing the path and "fName" is a variable containing the file name. You can combine these into one variable. This may prompt the user to overwrite an existing file if there is a naming conflict.

Dan.
 

Do you mean prevent them doing Save As themselves.

If so use (must be in the Workbook code module)...

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As _
Boolean, Cancel As Boolean)
If SaveAsUI = True Then
MsgBox "I couldn't possibly allow you to do that"
Cancel = True
End If
End Sub
 

Add "activeworkbook.save" a line before before "cancel = true" if you want save as to mean save....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top