win32com – 在Excel工作表中写入string值

我正在使用win32com写一些从数据库中得到的date,而我的问题是我的值是'01',在Excel中只是'1' – 而不是'01'。 例:

b = row[1] # b has the value 01 c = "-"+b+"-" # c has value -01- sheet.Cells(1,1).Value = b # I have in Excel '1' ; I've try with str(b), c - but is the same 

我怎样才能解决这个问题,在Excel中把这个值识别为一个string,在这种情况下,01?

谢谢。

感谢eumiro的重点

我find了解决scheme – 我正在格式化单元格以包含string值:

 range = sheet.Range(sheet.Cells(1, 1), sheet.Cells(100, 2) ) range.NumberFormat = '@' 

我这样做之前,我把价值单元格,它工作正常,现在在Excel单元格中我有string值。