H
hibou
Guest
bonour,
ci-dessous le debut de ma macro
la question : le fichier est 'hardcodé' dans la macro. Comment faire pour que l'utilisateur puisse en donner le nom (et le path) en interactif.
Alternative : ne pas poser de question, mais aller chercher le nom du fichier dans un onglet 'parametres' et mover le contenu de la cellule dzns la macro (avec un machin du genre &)
Merci de votre assistance.
hibou
'
Sheets('import').Select
Cells.Select
Selection.ClearContents
' Selection.QueryTable.Delete
Range('A1').Select
With ActiveSheet.QueryTables.Add(Connection:= _
'TEXT;C:\\mide\\brol\\CHRLAB1762.err', Destination:=Range('A1'))
.Name = 'CHRLAB1762_2'
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.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, 1, 1, 1)
.TextFileFixedColumnWidths = Array(5, 16, 17, 15, 8, 10, 35, 6, 6, 3, 9, 12, 2, 11, 2)
.Refresh BackgroundQuery:=False
End With
ci-dessous le debut de ma macro
la question : le fichier est 'hardcodé' dans la macro. Comment faire pour que l'utilisateur puisse en donner le nom (et le path) en interactif.
Alternative : ne pas poser de question, mais aller chercher le nom du fichier dans un onglet 'parametres' et mover le contenu de la cellule dzns la macro (avec un machin du genre &)
Merci de votre assistance.
hibou
'
Sheets('import').Select
Cells.Select
Selection.ClearContents
' Selection.QueryTable.Delete
Range('A1').Select
With ActiveSheet.QueryTables.Add(Connection:= _
'TEXT;C:\\mide\\brol\\CHRLAB1762.err', Destination:=Range('A1'))
.Name = 'CHRLAB1762_2'
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.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, 1, 1, 1)
.TextFileFixedColumnWidths = Array(5, 16, 17, 15, 8, 10, 35, 6, 6, 3, 9, 12, 2, 11, 2)
.Refresh BackgroundQuery:=False
End With