Bonjour tout le monde,


J'ai un probleme lorsque je fait un import de mon csv, en fait les nombres de type 1810400000000 sont convertis en 1,8104E+12 du cout mes calcules sont fausse.

voici le code VB que j'utilise:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Dim dw, ds, dr, qt As Object
 
Try
 
dw = GetWorkbook(Handle, Workbook)
ds = GetWorksheet(Handle, Workbook, Worksheet)
dr = ds.Range(Range)
qt = ds.QueryTables.Add(Connection:="TEXT;" & Path, Destination:=dr)
 
With qt
	.FieldNames = True
	.RowNumbers = False
	.FillAdjacentFormulas = False
	.PreserveFormatting = True
	.RefreshOnFileOpen = False
	.RefreshStyle = 1 'xlInsertDeleteCells
	.SavePassword = False
	.SaveData = True
	.AdjustColumnWidth = True
	.RefreshPeriod = 0
	.TextFilePromptOnRefresh = False
	.TextFilePlatform = 437
	.TextFileStartRow = 1
	.TextFileParseType = 1 'xlDelimited
	.TextFileTextQualifier = Qualifier
	.TextFileConsecutiveDelimiter = False
	.TextFileTabDelimiter = True
	.TextFileSemicolonDelimiter = True
	.TextFileCommaDelimiter = False
	.TextFileSpaceDelimiter = False
	.TextFileTrailingMinusNumbers = True
End With
qt.Refresh(False)
Success = True
 
Catch e As Exception
	Success = False
	Message = e.Message
Finally
	dw = Nothing
	ds = Nothing
	dr = Nothing 
	qt = Nothing
End Try

Je sais pas quel attribut a utiliser pour que je garde un format "Nombre" de type 1810400000000