View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Heiko Heiko is offline
external usenet poster
 
Posts: 16
Default Any way to set the Default Filename for a new document?

Hello Tim

Public Function mySaveAs()
Dim varName
Dim strDefault
strDefault = "Price Quotation - [Company Name Here]"
With ActiveWorkbook
If Not .Saved Then
varName = .Application.GetSaveAsFilename(strDefault,
"Microsoft Excel (*.xls),*.xls", , "Overwrite only Company")
If varName = False Then
Exit Function
End If
End If
End With
mySaveAs = varName
MsgBox varName
End Function

Heiko
:-)

"Tim" wrote:

I have an Excel Template (XLT) I've created. When the user creates a new file
from the template, it asks for certain information and fills those in on the
form automatically.

When the user goes to save, I'd like to have the default filename given in the
Save As dialog box be something like "Price Quotation - [Company Name
Here].xls". Right now, when you go to save, it is the same name as the XLT plus
a "1" at the end....

Anyway to set this in VBA?