Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When dumping data into an excel
sheet programmatically using C#, I run into the problem of Excel auto-formatting the cells based on the contents of the cells. For example, when placing a string of numbers such as '0000234', the cell will turn it into the number 234. We need to keep the preceding 0's for data integrity. Is there a way in C# to programmatically specify the cell format (such text, number, etc.) so that Excel will not automatically decide the cell's data format? Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When dumping data into an excel
sheet programmatically using C#, I run into the problem of Excel auto-formatting the cells based on the contents of the cells. I guess the question is how you are "dumping" the data. If you can set the NumberFormat of the cell to "@" (for text) before setting its Value property then the leading zeros should remain. Bill Manville MVP - Microsoft Excel, Oxford, England No email replies please - reply in newsgroup |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Setting rows to autofit wrapping text in a cell | Excel Discussion (Misc queries) | |||
Setting up a cell that contains text and a data reference? | Excel Worksheet Functions | |||
Display contents of cell in another cell as part of text string? | New Users to Excel | |||
Setting text as a background in cell | Excel Worksheet Functions | |||
Setting list box contents | Excel Programming |