import xml error

T

tope12

Im trying to make a form where the user will be able to pick an xml file and
import it to access. When I run the form, i get an error saying "Method
'ImportXML' of object'_Application' failed" This is code i used.

Private Sub Command2_Click()

Dim strfilter As String
Dim strInputFileName As String

strfilter = ahtAddFilterItem(strfilter, "XML Files (*.XML)", "*.XML")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strfilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)

Text0.Value = strInputFileName

End Sub

Private Sub Command3_Click()

Dim strfilter2 As String
strfilter2 = Text0.Value

'It highlights this area of the code below

Application.ImportXML _
DataSource = strfilter2, _
ImportOptions = acAppendData

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top