<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Solomon:<br>
<br>
I think "Val" will be a method on the Excel server. For example, if you
have<br>
&nbsp;&nbsp;&nbsp; <font color="#3333ff"><tt>xl =
win32com.client.Dispatch("Excel.Application")</tt></font><br>
<br>
for your server, you would have say something like<br>
&nbsp;&nbsp;&nbsp; <font color="#3333ff"><tt>iValue = xl.Val(worksheet.Cells(row,
col).Value)</tt></font><br>
<br>
Again, I haven't used Excel this way, so I'm just going by standard
object-oriented practice. You'll have to work out those details
yourself.<br>
<br>
- Greg Antal<br>
<pre class="moz-signature" cols="72">Gregory W. Antal
Senior Technical Advisor
ATA Engineering, Inc.
11995 El Camino Real, Suite 200        
San Diego, CA  92130
<a class="moz-txt-link-abbreviated" href="http://www.ata-e.com">www.ata-e.com</a>

<a class="moz-txt-link-abbreviated" href="mailto:greg.antal@ata-e.com">greg.antal@ata-e.com</a>
858-480-2072  (Phone)
858-792-8932  (Fax)</pre>
<br>
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Solomon.Zewdie.Altek@zf.com">Solomon.Zewdie.Altek@zf.com</a> wrote:
<blockquote
 cite="mid:8A13418356E45E4784744371A8B4DD79059ADBA6@frds00501.emea.zf-world.com"
 type="cite">
  <pre wrap="">I just tried it ( I did:  IntValue = Val(self.worksheet.Cells(row, col).Value)) 
Though It seems that the COM server doesn't know Val()... or am i doin something wrong??
I got the error: "NameError: global name 'Val' is not defined"
 

________________________________

Von: <a class="moz-txt-link-abbreviated" href="mailto:python-win32-bounces+solomon.zewdie.altek=zf.com@python.org">python-win32-bounces+solomon.zewdie.altek=zf.com@python.org</a> im Auftrag von Greg Antal
Gesendet: Mi 19.11.2008 17:15
An: <a class="moz-txt-link-abbreviated" href="mailto:python-win32@python.org">python-win32@python.org</a>
Betreff: Re: [python-win32] getting integer value for worksheet.Cells(row, col).Value



Solomon:

To do this in a Visual Basic module within Excel, you would use
   intValue = Val(worksheet.Cells(row, col).Value)

I haven't tried to use Excel as a COM server, but I think if you can use
the "Val()" function, you'll get the data you want instead of a string.

- Greg Antal

Gregory W. Antal
Senior Technical Advisor
ATA Engineering, Inc.
11995 El Camino Real, Suite 200
San Diego, CA  92130
<a class="moz-txt-link-abbreviated" href="http://www.ata-e.com">www.ata-e.com</a>

<a class="moz-txt-link-abbreviated" href="mailto:greg.antal@ata-e.com">greg.antal@ata-e.com</a>
858-480-2072  (Phone)
858-792-8932  (Fax)



<a class="moz-txt-link-abbreviated" href="mailto:Solomon.Zewdie.Altek@zf.com">Solomon.Zewdie.Altek@zf.com</a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi,
the statement:  worksheet.Cells(row, col).Value returns a Value of type of Strings,
Can anyone tell me how I can get an Integer value?
Casting (int(worksheet.Cells(row, col).Value ) didn't work.

Many Tnx!

solomon
_______________________________________________
python-win32 mailing list
<a class="moz-txt-link-abbreviated" href="mailto:python-win32@python.org">python-win32@python.org</a>
<a class="moz-txt-link-freetext" href="http://mail.python.org/mailman/listinfo/python-win32">http://mail.python.org/mailman/listinfo/python-win32</a>
 
    </pre>
  </blockquote>
  <pre wrap=""><!---->_______________________________________________
python-win32 mailing list
<a class="moz-txt-link-abbreviated" href="mailto:python-win32@python.org">python-win32@python.org</a>
<a class="moz-txt-link-freetext" href="http://mail.python.org/mailman/listinfo/python-win32">http://mail.python.org/mailman/listinfo/python-win32</a>


  </pre>
</blockquote>
</body>
</html>