Exporting Workbook to Various Formats

A workbook can be exported to the following formats: MHT, HTML, PDF, XLS, XLSX, RTF, EMF, PPTX.

Executing the example requires that the repository contains a workbook with the OBJ123 identifier which is to be exported.

Add links to the following system assemblies:

Example

Sub UserProc;
Var
    MB: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
    MObj: IMetabaseObject;
    Exp: IEaxAnalyzer;
    Export: IExAnalyzerExporter;
Begin
    MB := MetabaseClass.Active;
    //Open a workbook to edit
    MObj := MB.ItemById("OBJ123").Edit;
    Exp := MObj As IEaxAnalyzer;
    Export := New ExAnalyzerExporter.Create;
    Export.ExAnalyzer := Exp;
    //Export the workbook to XLS format
    Export.ExportToFile("C:\GDP ratio.xls""XLS");
End Sub UserProc;

After executing the example the workbook is saved on the local disk in XLS format.

See also:

Examples