GeSHi (qtp):
'This is a pure vbscript to get the no' of columns:'Create an Excel Object modelSet ExcelFile =
CreateObject("Excel.Application")'You can set it to false as wellExcelFile.
Visible =
true'Open the Excel fileExcelFile.
Workbooks.
Open "C:\Demo.xls"'Get the 1st sheet (can be change to some other index number)Set ExcelSheet = ExcelFile.
Sheets.
Item(1)'Get the number of columnsCols = ExcelSheet.
UsedRange.
Columns.
Countmsgbox "No of Columns: " & Cols
Set ExcelSheet =
nothingExcelFile.
QuitSet ExcelFile =
nothing Created by GeSHI 1.0.7.20