VBA/Excel/Access/Word/Access/Access XML

Материал из VB Эксперт

Перейти к: навигация, поиск

Содержание

Emport table as XML file

 
Sub TestExportXML()
    Application.ExportXML acExportTable, "tblEmployees", "c:\Employees.xml", "c:\ExmployeesSchema.xml"
 
End Sub



Export to an XML file

 
Sub ExportcustXML()
    Application.ExportXML _
     ObjectType:=acExportTable, DataSource:="Employees", DataTarget:="c:\Companyxml.xml", _
     SchemaTarget:="CompanySchema.xml", _
     OtherFlags:=1
 
End Sub



Import an XML file

 
Sub ImportXML(path As String)
  Application.ImportXML DataSource:=path, ImportOptions:=acStructureAndData
End Sub



Import XML file

 
Sub TestImportXML()
    Application.ImportXML "c:\Employees.xml", acStructureAndData
End Sub