[python-win32] Problem about formatting a cell in Excel

Fabricio Guzman fguzman_slotown at yahoo.com
Tue Oct 5 19:20:06 CEST 2004


try this:
xlWorksheet.Cells(a, b).Value = "'%1"

the apostrophe prefix converts the value to a string
constant and excel does not attempt any parsing.

-Fabricio

--- Lu Zheng <luzheng at gmail.com> wrote:

> Hi, all,
> 
> I am trying to copy some strings from a txt file
> into Excel. And I found that,
> when I do this:
>        'xlWorksheet.Cells(a, b).Value = "%1"', 
> excel will format the string "%1" to "1%" when
> display and the actual value
> becomes 0.01
> 
> How can I turn this autoformatting thing off so that
> "%1" will remain "%1"?
> 
> Thanks for your help :p
> 
> Regards,
> Lu Zheng
> 
> _______________________________________________
> Python-win32 mailing list
> Python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
> 



		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com


More information about the Python-win32 mailing list