Run Time Error - 62 (Input Past End of File)

Bonjour à tous,

J'ai ce code VBA que j'ai écris pour extraire des données dans un fichier HTML et le ranger dans une feuille excel.

Le code marche parfaitement en France, mais quand une personnne se trouvant en Chine l'utilise ça afficher 'Run Time Error - 62 (Input Past End of File)'.

Si vous pouvez m'aider svp.

Merci.

Rudy

Le code est le suivant:

Private Sub cmd_extract_Click()

uf.Hide

Dim html As Object

Dim Tr As Object

Dim Td As Object

Dim Tab1 As Object

Dim file As String

Dim sh As Worksheet

file = txt

TextFile = FreeFile

Open file For Input As TextFile

Set HTML_Content = CreateObject("htmlfile")

HTML_Content.body.innerHtml = Input(LOF(TextFile), TextFile)

Column_Num_To_Start = 1

iRow = 2

iCol = Column_Num_To_Start

iTable = 0

For Each Tab1 In HTML_Content.getElementsByTagName("table")

With HTML_Content.getElementsByTagName("table")(iTable)

For Each Tr In .Rows

For Each Td In Tr.Cells

Application.ScreenUpdating = False

Sheets("Feuil2").Visible = True

Set sh = ActiveWorkbook.Worksheets("Feuil2")

With sh

sh.Select

.Cells(iRow, iCol).Select

.Cells(iRow, iCol) = Td.innerText

iCol = iCol + 1

End With

Next Td

iCol = Column_Num_To_Start

iRow = iRow + 1

Next Tr

End With

iTable = iTable + 1

iCol = Column_Num_To_Start

iRow = iRow + 1

Next Tab1

Sheets("Feuil2").Visible = False

Application.ScreenUpdating = True

End Sub

Rechercher des sujets similaires à "run time error input past end file"