Set data type like number, text and date in excel column using Microsoft.Office.Interop.Excel in c#

前端 未结 3 1088
猫巷女王i
猫巷女王i 2020-12-01 21:32

My problem is that I am trying to set data type to an excel column in C#, in this case the data types number, text and date. I am using the DLL Microsoft.Office.Interop.Exce

3条回答
  •  广开言路
    2020-12-01 21:57

    Yes, with the date format everything is more complicated - even more complicated than Sid Holland has mentioned. The reason is in some localization problems. For example, if your Windows system has Russian localization, you should use Russian letters in the date formats, like "ДД.MM.ГГГГ" or "ГГГГ-MM-ДД", and, therefore, you should be able to extract and apply these letters. See more or less complete description and solution here: https://stackoverflow.com/a/35418176/2199512

提交回复
热议问题