xlapp = Dispatch("Excel.Application")
wkbk = xlapp.Workbooks.Open(filename)
This is the method used to read the excel file but I am unable to get the content of the excel. Can anyone suggest me a better way to handle this
xlapp = Dispatch("Excel.Application")
wkbk = xlapp.Workbooks.Open(filename)
This is the method used to read the excel file but I am unable to get the content of the excel. Can anyone suggest me a better way to handle this
xlwings is an excellent library to interact with Excel files from Python.
Opening, reading and writing to Workbooks is as easy as:
>>> from xlwings import Workbook, Sheet, Range, Chart
>>> wb = Workbook() # Creates a connection with a new workbook
>>> Range('A1').value = 'Foo 1'
>>> Range('A1').value
'Foo 1'
You can install it using:
$ pip install xlwings
You can try by installing xlrd and xlwt python packages which will helps you to open the Excel workbook virtually. you can refer this links for examples http://www.youlikeprogramming.com/2012/03/examples-reading-excel-xls-documents-using-pythons-xlrd/