Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
file won't save!
Any idea why this line of code won't save the file?? The "Save AS" box comes
up the user hits save and the macro contiunes like nothing is wrong. However, the file does not save. The vairable fname, which is the default file name, is working fine! FileSaveName = Application.GetSaveAsFilename(fname, filefilter:="Excel Files (*.xls),*.xls") |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
file won't save!
The GetSaveAsFilename does not save the file, it only allows the user to
provide the name of the file to save. After capturing the name with GetSaveAsFilename you have to actually save the file with another line of code. See example below: Sub SaveMe() Dim strName As String 'Variable for filename 'Get the file name by displaying the Save As dialog box strName = Application.GetSaveAsFilename(ActiveWorkbook.Name, _ "Excel Files (*.xls),*.xls") 'Save the file using the name just captured. ActiveWorkbook.SaveAs Filename:=strName End Sub All text prefaced by an apostrophe is a comment... -- Kevin Backmann "Mathew" wrote: Any idea why this line of code won't save the file?? The "Save AS" box comes up the user hits save and the macro contiunes like nothing is wrong. However, the file does not save. The vairable fname, which is the default file name, is working fine! FileSaveName = Application.GetSaveAsFilename(fname, filefilter:="Excel Files (*.xls),*.xls") |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
file won't save!
Kevin: thanks! I thought it would simply save the file.
"Kevin B" wrote: The GetSaveAsFilename does not save the file, it only allows the user to provide the name of the file to save. After capturing the name with GetSaveAsFilename you have to actually save the file with another line of code. See example below: Sub SaveMe() Dim strName As String 'Variable for filename 'Get the file name by displaying the Save As dialog box strName = Application.GetSaveAsFilename(ActiveWorkbook.Name, _ "Excel Files (*.xls),*.xls") 'Save the file using the name just captured. ActiveWorkbook.SaveAs Filename:=strName End Sub All text prefaced by an apostrophe is a comment... -- Kevin Backmann "Mathew" wrote: Any idea why this line of code won't save the file?? The "Save AS" box comes up the user hits save and the macro contiunes like nothing is wrong. However, the file does not save. The vairable fname, which is the default file name, is working fine! FileSaveName = Application.GetSaveAsFilename(fname, filefilter:="Excel Files (*.xls),*.xls") |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
SAVE and SAVE AS options disappeared from the drop down FILE menu | Excel Discussion (Misc queries) | |||
when i save xls file, debug script is running and canno't save fil | Excel Discussion (Misc queries) | |||
Excell2003 (SP-1) File > Save and File > Save As.. grayed out | Excel Discussion (Misc queries) | |||
Save & Save As features in file menu of Excel | Excel Discussion (Misc queries) | |||
Save Excel file - prompts to save - no Volitile functions used | Excel Worksheet Functions |