Get number of columns in Excel from UFT

  • Questions
  • Get number of columns in Excel from UFT
Question ID: 106560
0
0

How can I get the number of active columns in an Excel file using UFT?

Marked as spam
Posted by (Questions: 175, Answers: 22)
Asked on December 30, 2015 8:13 pm
8 views
Answers (1)
0
Private answer

Here you go:

Set objExcel = CreateObject(''Excel.Application'')
Set objWorkbook = objExcel.Workbooks.Open(''C:UsersrichDocumentsMySheet.xlsx'')
Set objWorkSheet = objExcel.ActiveWorkbook.Worksheets(''Sheet1'')
Set objRange = objWorksheet.UsedRange

ColumnCount = objRange.Columns.Count
MsgBox ColumnCount

Marked as spam
Posted by (Questions: 2, Answers: 425)
Answered on December 30, 2015 8:15 pm