Re : ! Ouverture fichier dans feuille calcul !
Re bonjour,tototiti2008
J'ai integrer ton code dans une boucle for ou a chaque iteration j'ouvre une nouvelle page HTML. Cependant quand je laisse un nom fixe la macro marche,
quand je veux ouvrir le fichier HTML dont le nom est le contenu de la case A indice i, ca plante.
As tu une idee ? je pense c'est une histoire de guillemets... mais je lutte dessus !
Merci d'avance
[QUOTESub Macro1()
Dim calc As Range, y As Range, x As Integer
'Calculate the number of values in a column
Set calc = Range("A:A").Find(" ", , xlValues, xlWhole, , , False)
'Find line offset of the last cell in the column A
x = Range("A" & Application.Rows.Count).End(xlUp).Row
For i = 1 To x
' Add a sheet and open an HTML report------------------------------------------------------------------------
Worksheets.Add
With ActiveSheet.QueryTables.Add(Connection:= _
"FINDER;file:///C:/_U1/PROGRAMME/NI_8.5/PROGRAMME_LV85/Report/" & Range("A" & i).Value & ".html", Destination:=Range("A1"))
.Name = "HTML_TEST(1)"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
.Delete
End With
Next
'
End Sub
[/QUOTE]