VBA/Excel/Access/Word/Excel/Workbook SaveAs — различия между версиями

Материал из VB Эксперт
Перейти к: навигация, поиск
м (1 версия)
 
м (1 версия)
 
(нет различий)

Текущая версия на 12:47, 26 мая 2010

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