Forum Discussion

SanM's avatar
SanM
Occasional Contributor
7 years ago

How to get the Excel sheet names using OLE object python testcomplete

I am new to the TC and code

 

gExcel = Sys.OleObject["Excel.Application"]
except:
Log.Warning("Unable to intialize the excel file.")
return

Wrkbk = gExcel.Workbooks.Open(Excel_path)
gExcel.Visible = True


## here i am getting a error as it is not able to get details
eDetailsSheet = objSheet.Sheets(1)
(or)
eTestDataSheet = gExcel.Sheets("TestData")

 

Please let me know how I can get the sheet names?

3 Replies