Open Excel with a XML file and SaveAs XLS

L

Li Pang

Hi,

I want to open Excel with a XML file and save back to a xls file, using the
following codes:
' Create the Excel App Object
Dim xlApp = CreateObject("Excel.Application")

' Create the Excel Workbook Object.
Dim xlBook = xlApp.Workbooks.Open("c:\temp\xx.xml")

' Set the value of the Cell
'xlBook.Worksheets(xlWorksheet).range(xlCellName).V(alue =
xlCellContents)

' Save changes and close the spreadsheet
xlBook.SaveAs("c:\temp\4.xls")

However "4.xls" is still a xml file but not a xls file. Anybody know that?
Thanks in advance
 

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