Ho questo codice:
codice:
Imports Excel = Microsoft.Office.Interop.Excel
Private Function.......
Dim oExcelFile As Object
Const xlDelimited As Integer = 1
Const xlDoubleQuote As Integer =1
Const xlExcel7 As Integer = 39
' Open Excel application object
Try
oExcelFile = GetObject(, "Excel.Application")
Catch
oExcelFile = CreateObject("Excel.Application")
End Try
oExcelFile.Visible = False
oExcelFile.Workbooks.OpenText("c:\pippo.txt", SemiColon:=True, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, TAB:=True, _
Comma:=False, Space:=False, Other:=False, TrailingMinusNumbers:=False)
oExcelFile.DisplayAlerts = False
' Save the file as XLS
oExcelFile.ActiveWorkbook.SaveAs("c:\pippo.xls", FileFormat:=Excel.XlFileFormat.xlExcel5, CreateBackup:=False)
end Function
file pippo.txt è fatto così
titolo;numero
1;4150203416035
2;123
una volta salvato tutto apro il foglio excel cosa trovo:
titolo numero
1 14,1502E+12
2 123
fino qui tutto ok:
ma come faccio a risolvere quel problema che non voglio 14,1502E+12 ma voglio 4150203416035
Grazie