diff --git a/components/fpspreadsheet/examples/excel5demo/excel5read.lpi b/components/fpspreadsheet/examples/excel5demo/excel5read.lpi
index 8051e80a7..81822828c 100644
--- a/components/fpspreadsheet/examples/excel5demo/excel5read.lpi
+++ b/components/fpspreadsheet/examples/excel5demo/excel5read.lpi
@@ -11,7 +11,7 @@
-
+
@@ -33,7 +33,7 @@
-
+
@@ -68,8 +68,8 @@
-
-
+
+
@@ -86,9 +86,9 @@
-
-
-
+
+
+
@@ -97,7 +97,7 @@
-
+
@@ -119,7 +119,7 @@
-
+
@@ -148,124 +148,137 @@
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
+
+
+
+
diff --git a/components/fpspreadsheet/examples/excel5demo/excel5write.lpi b/components/fpspreadsheet/examples/excel5demo/excel5write.lpi
index 8a3733403..eb6ea9847 100644
--- a/components/fpspreadsheet/examples/excel5demo/excel5write.lpi
+++ b/components/fpspreadsheet/examples/excel5demo/excel5write.lpi
@@ -11,7 +11,7 @@
-
+
@@ -38,8 +38,8 @@
-
-
+
+
@@ -68,8 +68,8 @@
-
-
+
+
diff --git a/components/fpspreadsheet/reference/excelfileformat.pdf b/components/fpspreadsheet/reference/excelfileformat.pdf
new file mode 100644
index 000000000..84c1a4ed6
Binary files /dev/null and b/components/fpspreadsheet/reference/excelfileformat.pdf differ
diff --git a/components/fpspreadsheet/xlsbiff5.pas b/components/fpspreadsheet/xlsbiff5.pas
index fa78cecd2..f7df36bec 100755
--- a/components/fpspreadsheet/xlsbiff5.pas
+++ b/components/fpspreadsheet/xlsbiff5.pas
@@ -1045,8 +1045,27 @@ begin
end;
procedure TsSpreadBIFF5Reader.ReadLabel(AStream: TStream);
+var
+ L: Word;
+ ARow, ACol: Word;
+ AValue: array[0..255] of Char;
+ AStrValue: ansistring;
begin
+ { BIFF Record data }
+ ARow := WordLEToN(AStream.ReadWord);
+ ACol := WordLEToN(AStream.ReadWord);
+ { Index to XF record }
+ AStream.ReadWord();
+
+ { Byte String with 16-bit size }
+ L := AStream.ReadWord();
+ AStream.ReadBuffer(AValue, L);
+ AValue[L] := #0;
+ AStrValue := AValue;
+
+ { Save the data }
+ FWorksheet.WriteUTF8Text(ARow, ACol, AnsiToUTF8(AStrValue));
end;
procedure TsSpreadBIFF5Reader.ReadNumber(AStream: TStream);
diff --git a/components/fpspreadsheet/xlsbiff8.pas b/components/fpspreadsheet/xlsbiff8.pas
index ce58f100e..9a16620c7 100755
--- a/components/fpspreadsheet/xlsbiff8.pas
+++ b/components/fpspreadsheet/xlsbiff8.pas
@@ -1,7 +1,7 @@
{
-xlsbiff5.pas
+xlsbiff8.pas
-Writes an Excel 5 file
+Writes an Excel 8 file
An Excel worksheet stream consists of a number of subsequent records.
To ensure a properly formed file, the following order must be respected:
@@ -10,7 +10,7 @@ To ensure a properly formed file, the following order must be respected:
2nd to Nth record: Any record
Last record: EOF
-Excel 5 files are OLE compound document files, and must be written using the
+Excel 8 files are OLE compound document files, and must be written using the
fpOLE library.
Records Needed to Make a BIFF5 File Microsoft Excel Can Use: