Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default link to a DHL tracking site

I need to create a link that will take a airbill tracking number I have
listed in column "C3" and when clicked, go to the status screen of the DHL
tracking website.
This is the site:
http://track.dhl-usa.com/TrackByNbr.asp
This is an example of a tracking number 38821115060
When I create the link I wind up at the home page, not the tracked info page.
Any suggestions would get me out of hot water.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default link to a DHL tracking site

Try this. Place a button on the sheet and link it to GetTrackingInfo.
Select a cell with a tracking number and click the button.


'add references to
' Microsoft Internet Controls
' Microsoft HTML Object Library

Sub GetTrackingInfo()


Dim IEObj As Object

Const S_URL As String = "http://track.dhl-usa.com/TrackByNbr.asp"
Dim doc As MSHTML.HTMLDocument
Dim s As String

If trim(ActiveCell.Value) < "" Then
s = Trim(ActiveCell.Value)
Else
Exit Sub
End If

Set IEObj = GetIE()
IEObj.Navigate S_URL
Do While IEObj.ReadyState < READYSTATE_COMPLETE
Loop
Set doc = IEObj.Document
doc.frmTrackByNbr.txtTrackNbrs.Value = s
doc.frmTrackByNbr.submit

End Sub

Function GetIE() As Object


Dim objShell As Object, objShellWindows As Object, o As Object
Dim retVal As Object, sURL As String


Set retVal = Nothing
Set objShell = CreateObject("Shell.Application")
Set objShellWindows = objShell.Windows

'see if IE is already open
For Each o In objShellWindows
sURL = ""
On Error Resume Next
sURL = o.Document.Location
On Error GoTo 0
If sURL < "" Then
Set retVal = o
Exit For
End If
Next o

If retVal Is Nothing Then
Set retVal = New InternetExplorer
retVal.Visible = True
End If

Set GetIE = retVal
End Function

"cbrah" wrote in message
...
I need to create a link that will take a airbill tracking number I
have
listed in column "C3" and when clicked, go to the status screen of
the DHL
tracking website.
This is the site:
http://track.dhl-usa.com/TrackByNbr.asp
This is an example of a tracking number 38821115060
When I create the link I wind up at the home page, not the tracked
info page.
Any suggestions would get me out of hot water.



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
Looking for Excel site similar to "The Word MVP Site" Doug New Users to Excel 1 January 25th 09 12:46 PM
Pivot Table Source Link changed when file saved to SharePoint site Barb Reinhardt Excel Discussion (Misc queries) 0 November 6th 07 07:55 PM
Error Message should link to Assistant Site George Brown New Users to Excel 0 October 19th 06 12:40 PM
How to insert tracking numbers into my webpage for RMA tracking wiglady Excel Discussion (Misc queries) 0 April 4th 06 12:44 PM
hyperlink to UPS tracking web site cbrah Excel Programming 3 March 2nd 05 04:58 PM


All times are GMT +1. The time now is 09:57 AM.

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"