Save As macro

R

robs3131

Hi all,

I've taken a macro that someone else created and modified it slightly - the
macro essentially brings up the "Save As" dialogue box (this is needed as
part of a larger macro). The macro works fine, the only thing being that now
when I go to the "Open" menu, there are the following two choices for Excel
files:

- Microsoft Office Excel Files
- All Microsoft Office Excel Files

Is there something I can change in the macro so that there is only one
choice when I to "Open"? Thanks for your help.

Code:

Private Sub cmdarchive_Click()

Dim intlen As Integer
Dim strnamewlen As String

Application.DisplayAlerts = False

' Save file name and path into a variable

intlen = Len(ActiveWorkbook.Name)
strnamewlen = Left(ActiveWorkbook.Name, intlen - 4)
template_file = strnamewlen

fileSaveName = Application.GetSaveAsFilename( _
InitialFileName:="C:\temp\" + template_file + " " +
VBA.Strings.Format(Now, "mm-dd-yyyy") + ".xls", _
fileFilter:="Excel Files (*.xls), *.xls")

If fileSaveName = False Then
Exit Sub
End If

ActiveWorkbook.SaveAs Filename:= _
fileSaveName, FileFormat:=xlNormal, _
CreateBackup:=False

Application.DisplayAlerts = True


End Sub
 
J

JLGWhiz

When you see the display with the two choices, if there is a drop down arrow
to the right, try clicking it and see if it goes back to one choice.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top