Cell Format in excel. [modified]
-
Hi, I am exporting some values into excelsheet. But when i open the excelsheet that time one column is showing some junk data but if i change the format of the cell from the excel then it is showing the correct data. I implemented export to excel using c# language. Any idea, how to set the cell format or any other way to show the data correctly with out changing the cell format from the excel. Thanks In Advance for better solution.
modified on Wednesday, December 2, 2009 6:55 AM
-
Hi, I am exporting some values into excelsheet. But when i open the excelsheet that time one column is showing some junk data but if i change the format of the cell from the excel then it is showing the correct data. I implemented export to excel using c# language. Any idea, how to set the cell format or any other way to show the data correctly with out changing the cell format from the excel. Thanks In Advance for better solution.
modified on Wednesday, December 2, 2009 6:55 AM
Assuming you are using excel objects to generate the excel file, you can use the "NumberFormat" property of the desired cell to what ever format you want. To know what format text to apply, just open an excel sheet, start recording a macro, and set the desired format. You can get the format string from the macro code.
-
Hi, I am exporting some values into excelsheet. But when i open the excelsheet that time one column is showing some junk data but if i change the format of the cell from the excel then it is showing the correct data. I implemented export to excel using c# language. Any idea, how to set the cell format or any other way to show the data correctly with out changing the cell format from the excel. Thanks In Advance for better solution.
modified on Wednesday, December 2, 2009 6:55 AM
Junk character means is it something with #### ? If this is so, it is because the whole data cant be shown because of insufficient space. It is normal and dont worry, the data is correctly there. If this is not the case, I think there is some problem. I need to know how are you exporting data to excel then. Is it using OleDb or InterOp ? :rose:
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascript -
Hi, I am exporting some values into excelsheet. But when i open the excelsheet that time one column is showing some junk data but if i change the format of the cell from the excel then it is showing the correct data. I implemented export to excel using c# language. Any idea, how to set the cell format or any other way to show the data correctly with out changing the cell format from the excel. Thanks In Advance for better solution.
modified on Wednesday, December 2, 2009 6:55 AM