LabWindows/CVI

ExcelRpt_WorkbookSave

HRESULT ExcelRpt_WorkbookSave (CAObjHandle workbookHandle, char filename[], enum ExREnum_ExFileFormat fileFormat);

Purpose

Saves a workbook in the specified format.

Parameters

Input
Name Type Description
workbookHandle CAObjHandle A handle to an Excel Workbook object.
filename char [] The filename to use for the workbook being saved. Pass NULL to use the current name of the workbook.
fileFormat enum ExREnum_ExFileFormat The file format for the workbook being saved. Must be one of the following ExREnum_ExFileFormat constants. See the Excel documentation for details.

ExRConst_DefaultFileFormat = 0
ExRConst_AddIn = 18
ExRConst_CSV = 6
ExRConst_CSVMac = 22
ExRConst_CSVMSDOS = 24
ExRConst_CSVWindows = 23
ExRConst_DBF2 = 7
ExRConst_DBF3 = 8
ExRConst_DBF4 = 11
ExRConst_DIF = 9
ExRConst_Excel2 = 16
ExRConst_Excel2FarEast = 27
ExRConst_Excel3 = 29
ExRConst_Excel4 = 33
ExRConst_Excel5 = 39
ExRConst_Excel7 = 39
ExRConst_Excel9795 = 43
ExRConst_Excel4Workbook = 35
ExRConst_IntlAddIn = 26
ExRConst_IntlMacro = 25
ExRConst_WorkbookNormal = –4143
ExRConst_SYLK = 2
ExRConst_Template = 17
ExRConst_CurrentPlatformText = –4158
ExRConst_TextMac = 19
ExRConst_TextMSDOS = 21
ExRConst_TextPrinter = 36
ExRConst_TextWindows = 20
ExRConst_WJ2WD1 = 14
ExRConst_WK1 = 5
ExRConst_WK1ALL = 31
ExRConst_WK1FMT = 30
ExRConst_WK3 = 15
ExRConst_WK4 = 38
ExRConst_WK3FM3 = 32
ExRConst_WKS = 4
ExRConst_Works2FarEast = 28
ExRConst_WQ1 = 34
ExRConst_WJ3 = 40
ExRConst_WJ3FJ3 = 41
ExRConst_UnicodeText = 42
ExRConst_Html = 44

Return Value

Name Type Description
status HRESULT A value indicating whether an error occurred. Function failure is indicated by a negative error code.

Error codes are defined in CVIversion\include\cviauto.h and <Program Files>\National Instruments\Shared\MSDTRedistributables\SDKHeaderFiles\8.1\winerror.h.

You can use CA_GetAutomationErrorString to get the description of an error code.

Additional Information

Library: Excel Report

Include file: activex\excel\ExcelReport.h

LabWindows/CVI compatibility: LabWindows/CVI 7.0 and later

Log in to get a better experience