bonjour à tous.
lorsque je transfert du texte en fin de compte je passe par uneonction openfile afin de choisir mon fichier à importer.
en test sur windows xp pas de pb
sur test sur machine avec windows 95 et excel 95
pb j'ai un erreur 1004 au niveau de la variable du fichier pour l'importation
Private Sub CommandButton1_Click()
' Cells.Select
' Selection.ClearContents
With ActiveSheet.QueryTables.Add(Connection:= _
'TEXT;' & ouvertureFichier, Destination:=Range('A5'))
.Name = 'Tedic440_1'
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 932
.TextFileStartRow = 11
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileFixedColumnWidths = Array(1, 7, 1, 3, 1, 7, 6, 32, 1, 9, 1, 25)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Columns('A:A').Select
Selection.Delete shift:=xlToLeft
Range('A1').Select
si qqn à une idée
je vous remercie
olivier [file name=Classeur1_20051123095409.zip size=23906]http://www.excel-downloads.com/components/com_simpleboard/uploaded/files/Classeur1_20051123095409.zip[/file]
Message édité par: oliv67, à: 23/11/2005 09:55
lorsque je transfert du texte en fin de compte je passe par uneonction openfile afin de choisir mon fichier à importer.
en test sur windows xp pas de pb
sur test sur machine avec windows 95 et excel 95
pb j'ai un erreur 1004 au niveau de la variable du fichier pour l'importation
Private Sub CommandButton1_Click()
' Cells.Select
' Selection.ClearContents
With ActiveSheet.QueryTables.Add(Connection:= _
'TEXT;' & ouvertureFichier, Destination:=Range('A5'))
.Name = 'Tedic440_1'
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 932
.TextFileStartRow = 11
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileFixedColumnWidths = Array(1, 7, 1, 3, 1, 7, 6, 32, 1, 9, 1, 25)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Columns('A:A').Select
Selection.Delete shift:=xlToLeft
Range('A1').Select
si qqn à une idée
je vous remercie
olivier [file name=Classeur1_20051123095409.zip size=23906]http://www.excel-downloads.com/components/com_simpleboard/uploaded/files/Classeur1_20051123095409.zip[/file]
Message édité par: oliv67, à: 23/11/2005 09:55