HI,
I am using code similar to the following code to write values into cells in an Excel worksheet:
Code:
Imports Microsoft.Office.Interop
Imports Microsoft.Office.Interop.Excel
Dim xlApp As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim WS As Excel.Worksheet
xlApp = New Excel.Application
xlWorkBook = xlApp.Workbooks.Open(strReportFile)
WS = xlWorkBook.Worksheets("TestReport")
Dim myCell As Range = CType(WS.Cells(1,1), Range)
Dim Value as string = "1234567890"
myCell.Value = Value
It works well except for when the string is a long number as shown above (1234567890).
In this case it displays the number in scientific notation.
The cells in the spreadsheet are formatted as "text" and if I type the number in the cell directly, it goes in as expected.
Any idea why it puts in scientific notation when I do it programatically?
Thanks in advance.