Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Looking for Excel site similar to "The Word MVP Site" | New Users to Excel | |||
Pivot Table Source Link changed when file saved to SharePoint site | Excel Discussion (Misc queries) | |||
Error Message should link to Assistant Site | New Users to Excel | |||
How to insert tracking numbers into my webpage for RMA tracking | Excel Discussion (Misc queries) | |||
hyperlink to UPS tracking web site | Excel Programming |