Quantcast
Channel: NetOffice - MS Office in .NET
Viewing all articles
Browse latest Browse all 1741

Created Unassigned: Excel XmlImportXml does not work [20704]

$
0
0
I have a function that imports xml data into a range in Excel. This have been working fine using the Excel interop, but when I changed to NetOffice it didn't work anymore.

I've tried to use the function differently, but no luck so far....
Sample:
strXML contains the XML to be inserted

```
Dim excel As NetOffice.ExcelApi.Application = Nothing
Dim exWb As NetOffice.ExcelApi.Workbook
Dim sht As NetOffice.ExcelApi.Worksheet

excel = New NetOffice.ExcelApi.Application
Dim xsd As NetOffice.ExcelApi.XmlMap = Nothing
exWb.XmlImportXml(strXML, xsd, True, sht.Range("A1"))

```

Error:
Parameter not optional. (Exception from HRESULT: 0x8002000F (DISP_E_PARAMNOTOPTIONAL))

All parameters has been filled. The xsd parameter is an out parameter...
I've tried to reduce to (strXML, xsd) parameters. But same result.

I've also tried to go directly from a dataset with dataset.GetXML and dataset.GetXmlSchema
Same result.

Viewing all articles
Browse latest Browse all 1741

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>