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: 227, Answers: 22)
Asked on December 30, 2015 8:13 pm
456 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: 477)
Answered on December 30, 2015 8:15 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top