Unable to open excel file with Sikuli IDE

Asked by Nitin Chaudhari on 2019-07-30

Hello,
Am new to sikuli and python. Am using Sikuli 1.1.3 on windows-10 64 bit desktop and trying to open xls file.
Have added xlrd in Lib as suggested in other threads. (xlrd- 1.2.0)
Added below code to open file. But unable to open excel file and not getting error in IDE.
----------------------------
import xlrd
import datetime
EXCELFILE = "C:\\Nitin\\test\\ESB_APP_CHEKC.xls"
book = xlrd.open_workbook(EXCELFILE)
sheet = book.sheet_by_index(1)
----------------------------
Could you please help on why excel file is not opening?
Thanks in advance.

Regards,
Nitin

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2019-08-01
Last query:
2019-08-01
Last reply:
2019-07-31
Nitin Chaudhari (cnitin) said : #1

Tried with App.open command like below and worked.
App.open ("C:\\Program Files (x86)\\Microsoft Office\\Office16\\EXCEL.EXE C:\\Nitin\\test\\ESB_APP_CHEKC.xls")
dont know why the other way is not working.

Best RaiMan (raimund-hocke) said : #2

- with App.open() you open the Excel application which shows your sheet in the GUI on the desktop

- with xlrd, the package opens the file in the background, which then can be accessed with the xlrd features like for example get the content of a specific cell for further evaluation in your script.
You do not "see" anything.

Nitin Chaudhari (cnitin) said : #3

Hello RaiMan,
Thanks a ton..!!
I was wondering why excel file is not displaying and there should be some problem with my installation.
Will try and test functions and will check; how effectiviely I can use xlrd.
Btw can we use App.open() and xlrd.open_workbook(EXCELFILE) in same piece of code.

Regards,
Nitin Chaudhari

RaiMan (raimund-hocke) said : #4

should be possible to use both in one script.

Nitin Chaudhari (cnitin) said : #5

Thanks RaiMan, that solved my question.