Skip to main content

ExcelGetColCount

Structure

ExcelGetColCount

Type

Function

Description

This function returns the number of columns in the currently selected sheet in the Excel file.

Parameters

Example

Try
ExcelOpen("C:\Temp\TestExcel.xlsx")
ShowMessage(ExcelGetSheetCount)
ExcelGetSheetByIndex(1)
ShowMessage(ExcelGetRowCount&","&ExcelGetColCount) ' shows the number of rows and columns on the current sheet

ExcelClearSheet

ShowMessage(ExcelGetRowCount&","&ExcelGetColCount) ' shows 0,0
Except

ShowMessage(LastExceptionMessage) 'would display an error message from Windows if the file doesn't exist or cannot be opened.

End Try