Forum Discussion

Desktopapptesti's avatar
Desktopapptesti
Occasional Contributor
2 years ago
Solved

Row count in Excel File

Hi,

 

Row count is always returning 8 and 4 irrespective of the data available in the excel sheet. The file has only one column and 2 rows.

  Excel = Sys.OleObject["Excel.Application"]
  Excel.Workbooks.Open("C:\\EData.xlsx")
RowCount = Excel.ActiveSheet.UsedRange.Rows.Count
ColumnCount = Excel.ActiveSheet.UsedRange.Columns.Count

 Thanks in advance.

  • never mind, the excel file is corrupted. Code works fine for other excel files.