Pular para o conteúdo principal

ExcelSetCellAsDateTime

Structure

ExcelSetCellAsDateTime(iRow,iCol,dtValue)

Type

Procedure

Description

This procedure sets the indicated cell of the current sheet to the date/time value. The result may end up as a numeric instead of a date/time.

Parameters: 3

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

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

dtValue = The date/time to set the cell to.

Example

Try

ExcelNewFile(3,"v2003")

ExcelGetSheetByIndex(1)

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

ExcelSetCellAsDateTime(1,1,CDate("2021-08-11") 'Warning, this may push the numeric equivalent of the date instead of the date, itself!!!

ShowMessage(ExcelGetCellIsDateTime(1,1)) 'Should return "1"

Except

ShowMessage(LastExceptionMessage)

End Try