XLS crashed (xml from Oracle). Merge, Table

Hi,

1. I just bought the Flexcell FMX but it appears that the software does not support xls file from my client. I opened this xls file in notepad: It has xml structure and created by Oracle. Can you correct this? It is very important.

Can you get fast tips how to find in code:
2. Number of merged columns and rows for the given cell
3. Range (cells rectangle) for first formatted Table

thank you!

Hi,
Xls files are not xml files: They are binary files and to be more specific since Excel 95 they are OLE documents. Some programs make hacks by renaming xml or html files as "xls" so they are associated with Excel when you double click them, because Excel used to open them. Now Excel 2013/2016 will also normally refuse to open those files by complaining that the file extension doesn't match the file contents.

We support virtually all xls file formats (excel 2, 3, 4, 95, 97) and the only missing is Excel 1 which never actually existed for Windows. But all those are binary formats. We also support xlsx which is indeed xml, and of course csv, but sadly no other file formats.

I imagine those files you have are in "Excel 2003 xml" format, which was a short lived format introduced in Excel 2003 and deprecated in Excel 2007, which was kind of a predecessor for xlsx. But I can't really know: xml can be anything, and we can't sadly support every file format out there that Excel can open. (this would include stuff like lotus 123 or quattro pro files)

About the number of merged columns and rows for a merged cell, I am not sure I fully understand the request:  A cell is either merged or it is not, so the number would be 0 or 1?
What we have is:
xls.CellMergedBounds(row, col);

Which will return a TXlsCellRange with the "big bounds" of the cell. If the cell is not merged, this will return the cell. If not, it will return the first cell and the last cell of the merged cell that contains the cell at row, col. Would this be what you are looking at? Or am I understanding wrong? If I am, please explain me a little more what is what you would like to find out, there should be a way.

About the Range for a formatted table, sadly the "table" word is very overloaded in Excel and used for completely different stuff. So I will assume you refer to the "tables" that appear in the ribbon at the "insert" tab, "table". If those are the tables you were referring to, you can get the number of tables with:
xls.TableCountInSheet;
and an specific table with xls.GetTable. So you could use this code to read all the tables in a sheet:


            for i := 1 to xls.TableCountInSheet do
            begin
                TableDef := xls.GetTable(i);
                DoSomething(TableDef.Range);
            end;



Now, what I can't really say is what is the "first table" in a sheet. The code above will loop over all tables in the sheet, but the order is kind of arbitrary: It is the order in which tables were created.

If we define "first table" as the table nearest to A1, then you would have to loop and find the nearest table by looking at the ranges. But if you have for example a table at A2 and another at B1, it can get difficult to define what the first table is.