XML VBA Access 2010 import



我想在我的代码VBA集成指令导入XML文件。在我的条件的else分支中,我想添加一个命令来导入XML文件。你能给我一些建议(一个VBA指令做导入)吗?

   Private Sub Commande0_Click()
      Dim rep As String
      rep = Dir("C:UsersToufikDesktopXML*.*", vbDirectory)
      Do While (rep <> "")
         If (GetAttr("C:UsersToufikDesktopXML" & rep) And vbDirectory) = vbDirectory Then
            MsgBox "Directory " & rep
         Else
            MsgBox "File " & rep
         End If 
         rep = Dir
      Loop
   End Sub

如果您想使用VBA将XML数据导入Access,您应该检查Application.ImportXML方法,如下所述:

http://msdn.microsoft.com/en-us/library/ff823157%28v=office.14%29.aspx

最新更新