Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 144
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 144
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to Insert Current Date into cell - Macro to "Save As" Guy[_2_] Excel Worksheet Functions 4 December 12th 08 08:20 PM
Macro to Save without the Save Message Ellen G Excel Discussion (Misc queries) 4 February 23rd 07 08:52 PM
"Save" macro problem, still prompted to save when closing workbook (?) StargateFanFromWork[_4_] Excel Programming 8 September 13th 06 04:49 PM
ASP: Open Excel File with Macro, Allow Macro to run, and then save delgados129 Excel Programming 0 March 10th 05 09:35 PM
Prompted to save changes after macro save - why? Izar Arcturus Excel Programming 2 December 10th 03 09:27 PM


All times are GMT +1. The time now is 03:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"