VBA/Excel/Access/Word/Excel/Workbook SaveAs

Материал из VB Эксперт
Версия от 12:47, 26 мая 2010; Admin (обсуждение | вклад) (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):

 
Sub save()
    ActiveWorkbook.SaveAs Filename:="\\server2\Public\Building Schedule.xls", _
            FileFormat:=xlExcel9795
End Sub



Save the active workbook

 
Sub save()
    ActiveWorkbook.SaveAs FileName:="Salaries.xls"
End Sub



Saving All Open Workbooks

 
Sub Save_All_Workbooks()
    Dim myWorkbook As Workbook
    For Each myWorkbook In Workbooks
        myWorkbook.Save
    Next myWorkbook
End Sub



Saving a Workbook That Has Already Been Saved

 
Sub save()
    Workbooks("Data Book.doc").Save
End Sub



xlExcelaves Document As An Excel workbook for Excel versions 95 and later

 
Sub save()
    ActiveWorkbook.SaveAs Filename:="\\server2\Public\Building Schedule.xls", _
            FileFormat:=xlExcel9795



xlHtml Saves Document As A web page

 
Sub save()
    ActiveWorkbook.SaveAs Filename:="\\server2\Public\Building Schedule.xls", _
            FileFormat:=xlHtml
End Sub



xlNormal: Saves Document As A normal workbook

 
Sub save()
    ActiveWorkbook.SaveAs Filename:="\\server2\Public\Building Schedule.xls", _
            FileFormat:=xlNormal
End Sub



xlTemplate Saves Document As A template

 
Sub save()
    ActiveWorkbook.SaveAs Filename:="\\server2\Public\Building Schedule.xls", _
            FileFormat:=xlTemplate
End Sub



xlWebArchive Saves Document As A single file web page

 
Sub save()
    ActiveWorkbook.SaveAs Filename:="\\server2\Public\Building Schedule.xls", _
            FileFormat:=xlWebArchive
End Sub



xlXMLSpreadsheet: Saves Document As An XML spreadsheet

 
Sub save()
    ActiveWorkbook.SaveAs Filename:="\\server2\Public\Building Schedule.xls", _
            FileFormat:=xlXMLSpreadsheet
End Sub