Pular para o conteúdo principal

ExcelGetCellAsDateTime

Structure

ExcelGetCellAsDateTime(iRow,iCol)

Type

Function

Description

This function returns the date/time value of the cell or formula result, if possible. Note that numbers will also return the corresponding date/time value. It will throw an exception otherwise.

Parameters: 2

iRow = The row of the cell. 1 is the top row.

iCol = The column of the cell. 1 corresponds to column A

Example

Try

ExcelNewFile(3,"v2003")

ExcelGetSheetByIndex(1)

ShowMessage(ExcelGetCellIsDateTime(1,1)) 'Returns "0"

ExcelSetCellAsDateTime(1,1,CDate("2021-08-11")

ShowMessage(ExcelGetCellAsDateTime(1,1)) 'Returns 08/11/2021

Except

ShowMessage(LastExceptionMessage)

End Try