We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

DateTime FormatException

Hi,
this code produces "System.FormatException: Input string was not in a correct format." exception when last line of the code is reached.

            ExcelEngine excelEngine = new ExcelEngine();
            IApplication application = excelEngine.Excel;
            application.DefaultVersion = ExcelVersion.Excel2013;
            IWorkbook workbook = application.Workbooks.Create(1);
            IWorksheet worksheet = workbook.Worksheets[0];
            worksheet.Range[1, 1].DateTime = new DateTime(2016, 12, 20, 23, 25, 20);
            System.IO.MemoryStream stream = new System.IO.MemoryStream();
            workbook.SaveAs(stream);

Why and how to fix it?

3 Replies

SS Sridhar Sukumar Syncfusion Team December 21, 2016 01:04 PM UTC

Hi Martin, 
 
Thank you for contacting Syncfusion support. 
 

We are unable to reproduce the issue from our side. We suspect that this issue might be raised based on the machine culture. So, kindly share us the details about your machine culture which will be helpful for us to investigate further on this. 

  

Regards, 
Sridhar S. 



MD Martin Dusek December 21, 2016 11:32 PM UTC

Hi Sridhar,
my tablet is in Czech language.

Best regards

Martin


SS Sridhar Sukumar Syncfusion Team December 22, 2016 09:18 AM UTC

Hi Martin, 
 

We were able to reproduce the issue and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates 

  

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents  

  

Please let me know if you have any questions. 

 

Regards, 
Sridhar S. 


SIGN IN To post a reply.
Loader.
Up arrow icon