Application.GetSaveAsFilename - 使用VBA自动保存
是否可以在没有“另存为对话框”的情况下保存文件?
单击按钮后生成文件和名称,现在我需要保存该文件而不“另存为对话框”
编辑: 问题不在于保存excel文件。
答案 0 :(得分:1)
您可以使用Workbook.SaveAs
有关详细信息,请查看以下网页:
Workbook.SaveAs Method (Excel)
<强>语法:强>
Workbook.SaveAs(FileName,FileFormat,Password,WriteResPassword,ReadOnlyRecommended,CreateBackup,AccessMode,ConflictResolution,AddToMru,TextCodepage,TextVisualLayout,Local)
DataType = String; Description = File Full Path; DefaultValue = ""
DataType = XlFileFormat; Description = File Extension;
DataType = String; Description = Protection Password; DefaultValue = ""
DataType = String; Description = Write Reservation Password; DefaultValue = ""
DataType = Boolean; Description = Show Read-Only Recommended Message; DefaultValue = False
DataType = Boolean; Description = Create Backup File; DefaultValue = False
DataType = XlSaveAsAccessMode; Description = Workbook Access Mode; DefaultValue = XlSaveAsAccessMode.xlNoChange
DataType = XlSaveConflictResolution; Description = Save Conflict Resolution; DefaultValue = XlSaveConflictResolution.xlUserResolution
DataType = Boolean; Description = Add to Recent Files; DefaultValue = False
Description = Ignored for all languages in Microsoft Excel.
Description = Ignored for all languages in Microsoft Excel.
DataType = Boolean; Description = Saving Local Language; DefaultValue = False