ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open Excel with a XML file and SaveAs XLS (https://www.excelbanter.com/excel-programming/366138-open-excel-xml-file-saveas-xls.html)

Li Pang

Open Excel with a XML file and SaveAs XLS
 
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


All times are GMT +1. The time now is 02:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com