HotXLS Docs

Classic XLS workbook metadata preservation

HotXLS preserves workbook-level BIFF8 metadata records that Excel can place in classic .xls files. This includes saved-by metadata, workbook sharing metadata, and revision protection records that are not exposed as editable high-level API objects

Preserved records

API surface

type
  IXLSWorkbook = class
    property LastSavedBy: WideString;
    property EncryptionPassword: WideString;
  end;

  TXLSWorkbook = class
    property LastSavedBy: WideString;
    property EncryptionPassword: WideString;
  end;
      

The file-sharing and revision-protection records are intentionally preserved as raw BIFF record payloads. HotXLS does not reinterpret or rewrite their internal flags and password hashes, so an Excel-authored workbook can pass through HotXLS without losing that metadata

Update the saved-by user name

uses lxHandle;

var
  Workbook: TXLSWorkbook;
begin
  Workbook := TXLSWorkbook.Create;
  try
    Workbook.Open('shared-template.xls');
    Workbook.LastSavedBy := 'Build Server';
    Workbook.SaveAs('shared-template-updated.xls');
  finally
    Workbook.Free;
  end;
end;
      

Use encryption separately

Workbook sharing metadata is separate from HotXLS file encryption. To write an encrypted classic XLS file, set EncryptionPassword before saving:

Workbook.EncryptionPassword := 'secret';
Workbook.SaveAs('encrypted.xls');
      

Related topics