Read and write Excel files in Flex [Flex]

Have you ever thought about this possibility? Well this is it: as3xls is a cool library that enables you to import and export xls and CSV files. It can be extremely useful to your needs!

Here some little tutorials.

Here the examples (google code link is broken!).

And here and other version of the same lib, but in this one there’s a fix for the number of rows you can import. I highly suggest you to use this one then otherwise you’ll get stuck after just some thousands… ;)

Hopefully I’ll post some personal examples soon.

Happy coding!


  1. Timmy says:

    I am using as3xls library in my air application to read and write data to Excel file.
    I facing an issue.I am able to read an excel and in my application i will display the data so numbers to textinputs.I will modify those textinput and when i click on a button i need to update the same excel file which i read.I am bale to update the excel only one sheet. Now i try to read the same excel file which got modified now, i am getting null objetc reference errror.

    Please help me, my code given below
    import com.as3xls.xls.ExcelFile;
    import com.as3xls.xls.Sheet;

    private function onReadButtonClick():void
    var file:File = File.desktopDirectory;
    file = file.resolvePath(“test.xls”);
    var myFileStream:FileStream = new FileStream();, FileMode.READ);

    var byteArray:ByteArray = new ByteArray();
    myFileStream.readBytes( byteArray, 0, 0);

    var excelFile:ExcelFile = new ExcelFile();

    sheet0 = excelFile.sheets[0];


    txtAbout.text = sheet0.values[0];
    txtCost.text = sheet0.values[2][1].value;

    private function btnUpdate_clickHandler(event:MouseEvent):void

    var xls:ExcelFile = new ExcelFile();
    var bytes:ByteArray = xls.saveToByteArray();

    var file:File = File.desktopDirectory;

    file = file.resolvePath(“test.xls”);
    var myFileStream:FileStream = new FileStream();, FileMode.UPDATE);

  2. Kavya says:

    Does someone has any idea on how to delete a row from the excel using flex.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>