ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   refreshing web query (https://www.excelbanter.com/excel-programming/393597-refreshing-web-query.html)

ezil

refreshing web query
 
I placed web query with the following commands (part of the macro)

With ActiveSheet.QueryTables.Add(Connection:="URL;" & qurl,
Destination:=DataSheet.Cells(a, 5))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With

Then i placed another macro it worked well.
sub mac2()
activeworkbook.refreshall
end sub

But the following macro is not worked well it skips the refresh command and
goes
to next line immediately without refreshing

sub mac2()
activeworkbook.refreshall
activeworkbook.save
end sub

What is wrong with the macro?

Don Guillett

refreshing web query
 
Assuming it worked when you created it, try
Sheets("sheet1").QueryTables(1).refresh
or
activesheet.QueryTables(1).refresh

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"ezil" wrote in message
...
I placed web query with the following commands (part of the macro)

With ActiveSheet.QueryTables.Add(Connection:="URL;" & qurl,
Destination:=DataSheet.Cells(a, 5))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With

Then i placed another macro it worked well.
sub mac2()
activeworkbook.refreshall
end sub

But the following macro is not worked well it skips the refresh command
and
goes
to next line immediately without refreshing

sub mac2()
activeworkbook.refreshall
activeworkbook.save
end sub

What is wrong with the macro?



sloan[_2_]

refreshing web query
 
did this work?

"Don Guillett" wrote:

Assuming it worked when you created it, try
Sheets("sheet1").QueryTables(1).refresh
or
activesheet.QueryTables(1).refresh

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"ezil" wrote in message
...
I placed web query with the following commands (part of the macro)

With ActiveSheet.QueryTables.Add(Connection:="URL;" & qurl,
Destination:=DataSheet.Cells(a, 5))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With

Then i placed another macro it worked well.
sub mac2()
activeworkbook.refreshall
end sub

But the following macro is not worked well it skips the refresh command
and
goes
to next line immediately without refreshing

sub mac2()
activeworkbook.refreshall
activeworkbook.save
end sub

What is wrong with the macro?





All times are GMT +1. The time now is 12:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com