我想在我的代码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
方法,如下所述: