Thread: VB error
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
aw aw is offline
external usenet poster
 
Posts: 19
Default VB error

Would like to know the correct statement that make the following VB works


Sub import01()

Dim hfile(1 To 8), i As Integer

hfile1 = "T:\Abc\Consolid\htmPL\PLY.HTM"
hfile2 = "T:\Abc\Consolid\htmPL\PLB.HTM"
hfile3 = "T:\Abc\Consolid\htmPL\PLL.HTM"
hfile4 = "T:\Abc\Consolid\htmPL\PLPP.HTM"
hfile5 = "T:\Abc\Consolid\htmPL\PLR.HTM"
hfile6 = "T:\Abc\Consolid\htmPL\PLT.HTM"
hfile7 = "T:\Abc\Consolid\htmPL\PLSMHK.HTM"
hfile8 = "T:\Abc\Consolid\htmPL\PLSMH.HTM"

For i = 1 To 8

Workbooks.Open Filename:=hfile(i)

... vb code
... vb code
... vb code


Next

End sub



--
aw