Solomon:<br>In what way did <b>int(worksheet.Cells(row, col).Value </b>not work? It seems that it should have. (You should not do a "cast", you want a conversion). To find out what's going on, try something like:<br>
<br>alpha = worksheet.Cells(row,col).Value<br>print 'Value was=', repr(alpha)<br><br><div class="gmail_quote">Perhaps there is something about the received string that will not convert. For example, an empty string will give you a ValueError. You may have to use something like:<br>
try:<br> val = int(alpha)<br>except ValueError:<br> val = 0 # or do you want val = None ?<br>--<br>Vernon Cole<br><br>On Wed, Nov 19, 2008 at 1:55 AM, <span dir="ltr"><<a href="mailto:Solomon.Zewdie.Altek@zf.com">Solomon.Zewdie.Altek@zf.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>
the statement: worksheet.Cells(row, col).Value returns a Value of type of Strings,<br>
Can anyone tell me how I can get an Integer value?<br>
Casting (int(worksheet.Cells(row, col).Value ) didn't work.<br>
<br>
Many Tnx!<br>
<br>
solomon<br>
_______________________________________________<br>
python-win32 mailing list<br>
<a href="mailto:python-win32@python.org">python-win32@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-win32" target="_blank">http://mail.python.org/mailman/listinfo/python-win32</a><br>
</blockquote></div><br>