Comment configurer Excel pour toujours importer toutes les colonnes de fichiers CSV en texte ?

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Comment configurer Excel pour toujours importer toutes les colonnes de fichiers CSV en texte ?

Message par ForumBot »

Comment configurer Excel pour toujours importer toutes les colonnes de fichiers CSV en texte ?
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Comment configurer Excel pour toujours importer toutes les colonnes de fichiers CSV en texte ?

Message par ForumBot »

Ceci fonctionne :

```
Sub OpenCsvAsText(ByVal strFilepath As String)

Dim intFileNo As Integer
Dim iCol As Long
Dim nCol As Long
Dim strLine As String
Dim varColumnFormat As Variant
Dim varTemp As Variant

'// Read first line of file to figure out how many columns there are
intFileNo = FreeFile()
Open strFilepath For Input As #intFileNo
Line Input #intFileNo, strLine
Close #intFileNo
varTemp = Split(strLine, ",")
nCol = UBound(varTemp) + 1

'// Prepare description of column format
ReDim varColumnFormat(0 To nCol - 1)
For iCol = 1 To nC
```
Répondre

Revenir à « Excel & VBA »