HI,
Once a week I make HTML reports which then I store on my harddisc in one of the catalogues (data). Then I import these reports using such macro :
Sub import_zSieciWeb()
mypath = "C:/path/data"
myname = InputBox("FILE NAME")
With ActiveSheet.QueryTables.Add(Connection:="URL;" & mypath & "/" & myname & ".htm", Destination:=Range("A1"))
.PreserveFormatting = True
.Refresh BackgroundQuery:=False
End With
End Sub
unfortunatelly it does not work and marks the part of the code
.Refresh BackgroundQuery:=False
but when I change the code as below (giving the whole path) it's ok
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;/C:/path/data/report1.htm" _
, Destination:=Range("$A$1"))
.PreserveFormatting = True
.Refresh BackgroundQuery:=False
End With
End Sub
could you please help me to fix the first example ?
Irek.
Once a week I make HTML reports which then I store on my harddisc in one of the catalogues (data). Then I import these reports using such macro :
Sub import_zSieciWeb()
mypath = "C:/path/data"
myname = InputBox("FILE NAME")
With ActiveSheet.QueryTables.Add(Connection:="URL;" & mypath & "/" & myname & ".htm", Destination:=Range("A1"))
.PreserveFormatting = True
.Refresh BackgroundQuery:=False
End With
End Sub
unfortunatelly it does not work and marks the part of the code
.Refresh BackgroundQuery:=False
but when I change the code as below (giving the whole path) it's ok
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;/C:/path/data/report1.htm" _
, Destination:=Range("$A$1"))
.PreserveFormatting = True
.Refresh BackgroundQuery:=False
End With
End Sub
could you please help me to fix the first example ?
Irek.