Vous êtes ici: Help Topics > Customization > Calculation > CVEXCEL Function

CVEXCEL Function

The CVEXCEL function returns information from an Excel file. The function takes up to three parameters, the Excel file name and a formula, which can be as simple as a cell reference or name, as well as an optional ClientID Flag.

Syntax

CVEXCEL(<Excel file or Document Identifier>,<Excel calculation>,<ClientID Flag>)

This runs the Excel calculation on the file provided. Thus, a user can specify a calculation that uses all the functionality of Excel.

Parameters

  1. Excel file or Document Identifier. They are not case sensitive.
  2. Excel calculation. It is composed of a sheet name and a cell name.

    Note: The sheet name must be enclosed in single quotes to correctly interpret characters such as spaces or dashes in the name.

  3. ClientID Flag. It is optional and defines how the first argument is to be treated.

    0 – The first argument is an Excel file. This can be the full path or a relative path.

    1 – The first argument is a document Identifier of Caseware.

Example 1

CVEXCEL("C:\ExcelDoc.xls", "'Sheet 2'!A1") or

CVEXCEL("C:\ExcelDoc.xls", "'Sheet 2'!A1", 0 )

This returns the value of cell A1 in the worksheet named 'Sheet 2' in the specified document. Note that if the sheet name contains spaces, it must be enclosed in single quotes.

Example 2

CVEXCEL("ExcelDoc.xls", "'Sheet 2'!A1") or

CVEXCEL(".\ExcelDoc.xls", "'Sheet 2'!A1") or

CVEXCEL("..\ExcelDoc.xls", "'Sheet 2'!A1") or

CVEXCEL("ExcelDir\ExcelDoc.xls", "'Sheet 2'!A1")

This returns the value of cell A1 in the worksheet named 'Sheet 2' in the specified document with respect to the path of the present CaseView document or client file.

Example 3

CVEXCEL("CW_DOCID", "'Sheet 2'!A1", 1)

This returns the value of cell A1 in the worksheet named 'Sheet 2' in the document related to the specified document identifier.

Related Topics