Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Code to get hyperlinks from open web page.

Using Win xp and Office xp.
I go to a web-based database, enter my username and password which brings up
several hyperlinks for me to then follow and obtain data.
When I don't have time to follow the hyperlinks straight away I would like
to be able to run some code to get these hyperlink addresses into my
spreadsheet for later use .
Is this possible using VBA code?
I have tried linking a web query to my sheet but it does not give me any
joy.
Any assistance appreciated!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Code to get hyperlinks from open web page.

Can you verify the QueryTables.
Follows an example:

Dim qt As QueryTable
sqlstring = "select 96Sales.totals from 96Sales where profit < 5"
connstring = _
"ODBC;DSN=96SalesData;UID=Rep21;PWD=NUyHwYQI;Datab ase=96Sales"
With ActiveSheet.QueryTables.Add(Connection:=connstring , _
Destination:=Range("B1"), Sql:=sqlstring)
.Refresh
End With

Or other example:
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://noticias.uol.com.br/economia", Destination:=Range("A1"))
.Name = "economia"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "9"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With

Cleber


"Peter Jamieson" escreveu na mensagem
...
Using Win xp and Office xp.
I go to a web-based database, enter my username and password which brings

up
several hyperlinks for me to then follow and obtain data.
When I don't have time to follow the hyperlinks straight away I would

like
to be able to run some code to get these hyperlink addresses into my
spreadsheet for later use .
Is this possible using VBA code?
I have tried linking a web query to my sheet but it does not give me any
joy.
Any assistance appreciated!




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Code to get hyperlinks from open web page.

Thanks for your input Cleber!
However as I mentioned in my post I had tried the query approach you suggest
but it failed.
I think the reason is maybe related to the online db getting its data via
Javascript after a request is made.
Cheers, Peter J.

"Cleber P. de Souza" wrote in message
...
Can you verify the QueryTables.
Follows an example:

Dim qt As QueryTable
sqlstring = "select 96Sales.totals from 96Sales where profit < 5"
connstring = _
"ODBC;DSN=96SalesData;UID=Rep21;PWD=NUyHwYQI;Datab ase=96Sales"
With ActiveSheet.QueryTables.Add(Connection:=connstring , _
Destination:=Range("B1"), Sql:=sqlstring)
.Refresh
End With

Or other example:
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://noticias.uol.com.br/economia",

Destination:=Range("A1"))
.Name = "economia"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "9"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With

Cleber


"Peter Jamieson" escreveu na mensagem
...
Using Win xp and Office xp.
I go to a web-based database, enter my username and password which

brings
up
several hyperlinks for me to then follow and obtain data.
When I don't have time to follow the hyperlinks straight away I would

like
to be able to run some code to get these hyperlink addresses into my
spreadsheet for later use .
Is this possible using VBA code?
I have tried linking a web query to my sheet but it does not give me any
joy.
Any assistance appreciated!






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
ON OPEN VBA Code input incorrectly now excel sheet wont open mmartin New Users to Excel 1 February 16th 11 11:33 PM
My hyperlinks do not open ... Jed[_2_] Excel Discussion (Misc queries) 1 September 18th 09 03:21 PM
Need VB code for workbook open to open a link Daniel Baker Excel Discussion (Misc queries) 2 August 18th 06 01:30 AM
when i open a excel doc , it open muiltple page not related? greyshark001 Excel Discussion (Misc queries) 1 October 18th 05 05:15 PM
lock code in excel EX(hyperlinks) IAN R Excel Discussion (Misc queries) 0 May 31st 05 11:02 AM


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

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

About Us

"It's about Microsoft Excel"