VBA/Excel/Access/Word/Excel/Workbook SaveAs
Содержание
- 1 Saves the open workbook named Schedule.xls under the name Building Schedule.xls in the folder named \\server2\Public using the "Microsoft Excel format (from Excel 2003):
- 2 Save the active workbook
- 3 Saving All Open Workbooks
- 4 Saving a Workbook That Has Already Been Saved
- 5 xlExcelaves Document As An Excel workbook for Excel versions 95 and later
- 6 xlHtml Saves Document As A web page
- 7 xlNormal: Saves Document As A normal workbook
- 8 xlTemplate Saves Document As A template
- 9 xlWebArchive Saves Document As A single file web page
- 10 xlXMLSpreadsheet: Saves Document As An XML spreadsheet
Saves the open workbook named Schedule.xls under the name Building Schedule.xls in the folder named \\server2\Public using the "Microsoft Excel format (from Excel 2003):
<source lang="vb">
Sub save()
ActiveWorkbook.SaveAs Filename:="\\server2\Public\Building Schedule.xls", _ FileFormat:=xlExcel9795
End Sub
</source>
Save the active workbook
<source lang="vb">
Sub save()
ActiveWorkbook.SaveAs FileName:="Salaries.xls"
End Sub
</source>
Saving All Open Workbooks
<source lang="vb">
Sub Save_All_Workbooks()
Dim myWorkbook As Workbook For Each myWorkbook In Workbooks myWorkbook.Save Next myWorkbook
End Sub
</source>
Saving a Workbook That Has Already Been Saved
<source lang="vb">
Sub save()
Workbooks("Data Book.doc").Save
End Sub
</source>
xlExcelaves Document As An Excel workbook for Excel versions 95 and later
<source lang="vb">
Sub save()
ActiveWorkbook.SaveAs Filename:="\\server2\Public\Building Schedule.xls", _ FileFormat:=xlExcel9795 </source>
xlHtml Saves Document As A web page
<source lang="vb">
Sub save()
ActiveWorkbook.SaveAs Filename:="\\server2\Public\Building Schedule.xls", _ FileFormat:=xlHtml
End Sub
</source>
xlNormal: Saves Document As A normal workbook
<source lang="vb">
Sub save()
ActiveWorkbook.SaveAs Filename:="\\server2\Public\Building Schedule.xls", _ FileFormat:=xlNormal
End Sub
</source>
xlTemplate Saves Document As A template
<source lang="vb">
Sub save()
ActiveWorkbook.SaveAs Filename:="\\server2\Public\Building Schedule.xls", _ FileFormat:=xlTemplate
End Sub
</source>
xlWebArchive Saves Document As A single file web page
<source lang="vb">
Sub save()
ActiveWorkbook.SaveAs Filename:="\\server2\Public\Building Schedule.xls", _ FileFormat:=xlWebArchive
End Sub
</source>
xlXMLSpreadsheet: Saves Document As An XML spreadsheet
<source lang="vb">
Sub save()
ActiveWorkbook.SaveAs Filename:="\\server2\Public\Building Schedule.xls", _ FileFormat:=xlXMLSpreadsheet
End Sub
</source>