Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save As macro
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 -- Robert |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save As macro
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. "robs3131" wrote: 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 -- Robert |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save As macro
I just tried - there is no drop down arrow to the right.
-- Robert "JLGWhiz" wrote: 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. "robs3131" wrote: 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 -- Robert |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to Insert Current Date into cell - Macro to "Save As" | Excel Worksheet Functions | |||
Macro to Save without the Save Message | Excel Discussion (Misc queries) | |||
"Save" macro problem, still prompted to save when closing workbook (?) | Excel Programming | |||
ASP: Open Excel File with Macro, Allow Macro to run, and then save | Excel Programming | |||
Prompted to save changes after macro save - why? | Excel Programming |