Application.GetSaveAsFilename - 使用VBA自动保存

时间:2014-02-25 09:22:58

标签: vba autosave

Application.GetSaveAsFilename - 使用VBA自动保存

是否可以在没有“另存为对话框”的情况下保存文件?

单击按钮后生成文件和名称,现在我需要保存该文件而不“另存为对话框”

编辑: 问题不在于保存excel文件。

1 个答案:

答案 0 :(得分:1)

您可以使用Workbook.SaveAs

有关详细信息,请查看以下网页:

Workbook.SaveAs Method (Excel)

<强>语法:

Workbook.SaveAs(FileName,FileFormat,Password,WriteResPassword,ReadOnlyRecommended,CreateBackup,AccessMode,ConflictResolution,AddToMru,TextCodepage,TextVisualLayout,Local)

  1. FileName DataType = String; Description = File Full Path; DefaultValue = ""
  2. FileFormat DataType = XlFileFormat; Description = File Extension;
  3. 密码DataType = String; Description = Protection Password; DefaultValue = ""
  4. WriteResPassword DataType = String; Description = Write Reservation Password; DefaultValue = ""
  5. ReadOnlyRecommended DataType = Boolean; Description = Show Read-Only Recommended Message; DefaultValue = False
  6. CreateBackup DataType = Boolean; Description = Create Backup File; DefaultValue = False
  7. 访问模式DataType = XlSaveAsAccessMode; Description = Workbook Access Mode; DefaultValue = XlSaveAsAccessMode.xlNoChange
  8. ConflictResolution DataType = XlSaveConflictResolution; Description = Save Conflict Resolution; DefaultValue = XlSaveConflictResolution.xlUserResolution
  9. AddToMru DataType = Boolean; Description = Add to Recent Files; DefaultValue = False
  10. TextCodepage Description = Ignored for all languages in Microsoft Excel.
  11. TextVisualLayout Description = Ignored for all languages in Microsoft Excel.
  12. 本地DataType = Boolean; Description = Saving Local Language; DefaultValue = False