Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

MS Excel converts numbers to date from application written in WPF 2010

$
0
0

I export data to MS Excel. However, MS Excel shows incorrectly a field which consists entries like "10-14" or "11-14". MS Excel shows "10-14" like "Oct 14", "11-14" like "Nov 14". That is, if entry starts from "0-12", then MS Excel converts this numbers to months.

yeah, I know the way to alter an cell to "Text". Is there the way to assign cells as "Text" programmatically by WPF 2010?

dynamic MSexcel = Microsoft.VisualBasic.Interaction.CreateObject("Excel.Application", string.Empty);

MSexcel.ScreenUpdating = false;

dynamic workbooks = MSexcel.workbooks;

workbooks.Add();

dynamic worksail = MSexcel.ActiveSheet; 

dynamic tt = worksail.Range[worksail.Cells[top, left], worksail.Cells[bottom, right]];    

for (int i = 1; i <= 4; i++)

tt.Borders[i].LineStyle = 1;

tt.EntireColumn.AutoFit();

dynamic ttHeader = worksail.Range[worksheet.Cells[top, left], worksail.Cells[top, right]];

ttHeader.Font.Bold = true;

ttHeader.Interior.Color = 189 * (int)Math.Pow(16, 4) + 129 * (int)Math.Pow(16, 2) + 78; 

MSexcel.ScreenUpdating = true;

MSexcel.Visible = true;         



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>