Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default problem with VBA web query

Hello
I'm trying to build a database searching information in the web
through web queries but I really cannot get a good result using VBA.
The code is the following:

Sub ImportComments()

Dim QT As QueryTable

ConnectString = "URL;http://groups.google.com/group/
microsoft.public.excel.programming/browse_frm/month/2007-07"

Set QT = ActiveSheet.QueryTables.Add(Connection:=ConnectStr ing, _
Destination:=Range("A1"))

With QT
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingNone
.BackgroundQuery = False
.AdjustColumnWidth = True
.EnableRefresh = True
.RefreshStyle = xlOverwriteCells
.Refresh
End With

End Sub

If I proceed manually I can get any table.
Is there any way to make it with VBA?

Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default problem with VBA web query

Assuming you have your result. Record a macro while doing this:
select the first cell(a1) in the querydataimporteditselect tables
desiredimport
Look at the resulting macro

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"sea urchin" wrote in message
oups.com...
Hello
I'm trying to build a database searching information in the web
through web queries but I really cannot get a good result using VBA.
The code is the following:

Sub ImportComments()

Dim QT As QueryTable

ConnectString = "URL;
http://groups.google.com/group/
microsoft.public.excel.programming/browse_frm/month/2007-07"

Set QT = ActiveSheet.QueryTables.Add(Connection:=ConnectStr ing, _
Destination:=Range("A1"))

With QT
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingNone
.BackgroundQuery = False
.AdjustColumnWidth = True
.EnableRefresh = True
.RefreshStyle = xlOverwriteCells
.Refresh
End With

End Sub

If I proceed manually I can get any table.
Is there any way to make it with VBA?

Thanks!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Web Query sea urchin Excel Programming 1 July 18th 07 02:15 PM
Web query VBA problem Iain Excel Programming 7 March 21st 07 04:46 PM
Query Problem Freshman Excel Worksheet Functions 0 September 26th 06 09:57 AM
Problem with MS Query - can't edit query jarems Excel Discussion (Misc queries) 2 December 12th 05 09:42 AM
Problem with .Background Query option of ODBC Query Shilps Excel Programming 0 April 19th 04 06:41 AM


All times are GMT +1. The time now is 10:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"