question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sheet.Cell("B3").InsertData(table.AsEnumerable()) doesn't apply a user defined cell format

See original GitHub issue

This attached excel has a cell which is set a user defined cell format “yy/MM/dd”. format test.xlsx

But the following code doesn’t apply it when you open a saved file. It shows “2016/10/4” instead of “16/10/4”. You need to manually click and leave the cell to affect the format.

var table = new System.Data.DataTable();
table.Columns.Add("Date");
table.Rows.Add("2016/10/4");    
sheet.Cell("B3").InsertData(table.AsEnumerable());

But this code does work well. It shows “16/10/4” properly. sheet.Cell("B3").Value = "2016/10/4";

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
yooontheearthcommented, Mar 22, 2017

I confirmed that the bug was fixed. Thanks a lot!

0reactions
igiturcommented, Mar 20, 2017

The PR has been merged into the develop branch. I’d appreciate it if you could pull the develop branch and check that it solves your issue. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Table Number Formatting Doesn't Copy Down and ...
Learn why the number formatting for new rows of a table doesn't always get copied down and how to fix it.
Read more >
Create and apply a custom number format
Apply a custom number format · Select the cell or range of cells that you want to format. · On the Home tab,...
Read more >
Excel conditional formatting formulas based on another cell
Today are going to dwell on how to use Excel formulas to format individual cells and entire rows based on the values you...
Read more >
Format of a Cell, unrecognized number until I hit enter
I have a table that is created from a query. The query goes to a spreadsheet that I do not own. Within that...
Read more >
Apply Conditional Formatting to Multiple Cells with a Single ...
This means that you will not have to individually apply the formulas when ... Excel How To: Format Cells Based on Another Cell...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found