P
pedro_mpa
Hi.
I need help on a Web Query in the following VBA code working in Excel 2003
but not on Excel 2007 where the time for query never ends, it just hangs
forever. The excel file is in Office 2003 format (.xls).
Everything works fine in office 2003 but not on 2007.
Here is the code.
Public Sub doLocalWebQuery()
Call doWebQuery("http://pc5/s4/cablescad.php")
End Sub
Public Sub doExternalWebQuery()
Call doWebQuery("http://website.com/s4/cablescad.php")
End Sub
Private Sub doWebQuery(sURL As String)
Dim SheetName As String
SheetName = "EXTRACTION_BASE"
Dim Conn
Conn = "URL;" & sURL
Application.ScreenUpdating = False
Worksheets(SheetName).Cells.Clear
If Worksheets(SheetName).QueryTables.Count > 0 Then
Worksheets(SheetName).QueryTables(1).Refresh
Else
With Worksheets(SheetName).QueryTables.Add(Connection:=Conn,
Destination:=Worksheets(SheetName).Cells(1, 1))
.Refresh
End With
End If
Application.ScreenUpdating = True
End Sub
Thanks in advance.
Please apologize my bad English.
Pedro.
I need help on a Web Query in the following VBA code working in Excel 2003
but not on Excel 2007 where the time for query never ends, it just hangs
forever. The excel file is in Office 2003 format (.xls).
Everything works fine in office 2003 but not on 2007.
Here is the code.
Public Sub doLocalWebQuery()
Call doWebQuery("http://pc5/s4/cablescad.php")
End Sub
Public Sub doExternalWebQuery()
Call doWebQuery("http://website.com/s4/cablescad.php")
End Sub
Private Sub doWebQuery(sURL As String)
Dim SheetName As String
SheetName = "EXTRACTION_BASE"
Dim Conn
Conn = "URL;" & sURL
Application.ScreenUpdating = False
Worksheets(SheetName).Cells.Clear
If Worksheets(SheetName).QueryTables.Count > 0 Then
Worksheets(SheetName).QueryTables(1).Refresh
Else
With Worksheets(SheetName).QueryTables.Add(Connection:=Conn,
Destination:=Worksheets(SheetName).Cells(1, 1))
.Refresh
End With
End If
Application.ScreenUpdating = True
End Sub
Thanks in advance.
Please apologize my bad English.
Pedro.