Sep-23-2019, 09:18 PM
(This post was last modified: Sep-23-2019, 09:19 PM by newbieAuggie2019.)
(Sep-23-2019, 09:02 PM)Shafla Wrote: I have tried it once more and got the followingHi!
>>> import openpyxl >>> wb = openpyxl.load_workbook('Example_Page267.xlsx') >>> sheet = wb.get_sheet_by_name('Sheet1') >>> sheet['A1'] <Cell 'Sheet1'.A1> >>> sheet['A1'].value datetime.datetime(2015, 5, 4, 13, 34) >>> c = sheet['B1'] >>> c.value 'Apples' >>> 'Row ' + str(c.row) + ',Column ' + c.column + ' is ' + c.value Traceback (most recent call last): File "<pyshell#38>", line 1, in <module> 'Row ' + str(c.row) + ',Column ' + c.column + ' is ' + c.value TypeError: can only concatenate str (not "int") to str
Just a thought ... If rows need to be strings, maybe columns too ...
Have you tried changing line 11 from:
'Row ' + str(c.row) + ',Column ' + c.column + ' is ' + c.valueto:
'Row ' + str(c.row) + ',Column ' + str(c.column) + ' is ' + c.valueAll the best,
newbieAuggie2019
"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs