As I already have a wireless Internet, I present you a short but very useful code snippet.
For some time I had to return back to Microsoft operating system. I am developing a system for Windows… No no, I am not programming in something from Microsoft Studio this time. I am programming in Flash ActionScript with the extensions of Flash projector ZINK. I needed to use ActiveX for conversion from Excel *.xls format into Excel *.xml format, which is supported by Microsoft Office 2003, as you can do nothing well with the binary *.xls file while you don’t comprehend the XLS format. And when you already understand it, the format will be technologicaly old and you will have to learn the newer one
. But you can be cool with XML. XML can be easily read using ActionScript and the data can be used according the wishes and requirements.
Here is the conversion in the JScript language:
var oExcel = new ActiveXObject("Excel.Application");
var oWorkbook = Excel.Workbooks.Open("C:\\file.xls");
oWorkbook.SaveAs("C:\\file.xml", 46); //46-xml format
oExcel.Application.Quit();
The code snippet works in the cases, when there is Microsoft Office 2003 installed in the computer. It can be used AS IS in an HTML application or some other web application for Internet Explorer. After some modifications, the snippet can be used in the application implemented in Visual Basic or other high level programming language that has ActiveX/COM application programming interface (API).
It seems elementary, anyway it took me a few hours to form it by browsing in the web, downloading the trial of Office, and remembering the macro programming (“46″ is not so easy to get in the web) . The elementariness, in my opinion, is not worth as much time as it took for me, therefore I mention the code here and the Internet users will be able to google for it.
Tags: programming






hello
hi