[pywin32-bugs] [ pywin32-Bugs-1418081 ] Reads float from Excel cell instead of int
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2006-01-29 20:06:31
|
Bugs item #1418081, was opened at 2006-01-29 15:06 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1418081&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nick Jacobson (nickjacobson) Assigned to: Nobody/Anonymous (nobody) Summary: Reads float from Excel cell instead of int Initial Comment: When you read in an integer from an Excel cell, it is type float. And printing it will print e.g. "5.0" instead of "5". example: from win32com.client import Dispatch xlApp = Dispatch("Excel.Application") xlApp.Visible = 1 xlApp.Workbooks.Add() xlApp.ActiveSheet.Cells(1,1).Value = 5 print xlApp.ActiveSheet.Cells(1,1).Value print type(xlApp.ActiveSheet.Cells(1,1).Value) raw_input("paused") xlApp.Quit() This returns: 5.0 <type 'float'> paused I'm using Python 2.4.2 and Excel 2003 Pro. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1418081&group_id=78018 |