I have a piece of code where I am opening an XML file from VB NET console app, than I Save As this file as XLSX file
Dim oxl As Excel.Application
Dim owbs As Excel.Workbooks
Dim owb As Excel.Workbook
Dim osheets As Excel.Worksheets
Dim osheet As Excel.Worksheet
oxl = CreateObject("Excel.Application")
oxl.DisplayAlerts = True
oxl.Visible = True
owb = oxl.Workbooks.Open(file)
Dim newfile As String = Replace(file, ".xml", ".xlsx")
owb.SaveAs(newfile)
owb.Close()
oxl.Quit()
When I manualy open Excel 365, then I choose "Open file", I choose an XML file, Excel ask me, if I want to open it as an XML table and if I choose yes, table has another format, is coloured and headers in table are correct. When I open XML from my code, table isn't coloured, nevermind, but I have wrong table headers. Is it possible somehow open XML file as XML table from oxl.Workbooks.Open(file)?
I couldn't find a solution to my problem anywhere.
Is it possible somehow open XML file as XML table from oxl.Workbooks.Open(file)- by replacing it withoxl.Workbooks.OpenXML(file)?oxl.Workbooks.OpenXML(file)with same results likeoxl.Workbooks.Open(file)