I am using DataNitro in my spreadsheet. When I write the values to a cell. It automatically guesses if format looks like a date. This is obviously not always helpfull!

dt_str = "08/20/13"
Cell("A1").value = dt_str
# puts date type in that cell

I am not sure whether this behaviour is from Excel 2010 or from DataNitro side. As I am writing this i am getting more convinced that this is an Excel issue. Anybody with experience on this?

Done some more research and I almost conviced it is Excel Issue. Solutions when Entering data directly is starting the cell with a ' This is obviously? not possible if I come in from python.

有帮助吗?

解决方案

This is an Excel issue, and putting a single quote at the beginning is correct. You can do that as long as you use double quotes to delimit the string:

Cell("A1").value = "'10/1/2013"
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top