我有一个网址,日常常用到其中的单号查询,举例:999 77192323
在这个页面上进行配货查询,因为网页操作实在不便.
所以想转成EXCEL应用, VBA for EXCEL
我只懂VBA,粗略知道CreateObject("MSXML2.XMLHTTP")的使用.
以下代码不懂怎样改为网址获得内容,有没有高手指点一二?

[url]http://www.cargoserv.com/webtracking/ca/tracking.asp[/url]

[color=ff00ff]以下为网页源代码[/color]
<SCRIPT language = "javascript" src = "../../js/tracking_func.js"></SCRIPT>

<html>

<head>
<title>Cargo Shipment Information (Chinese)</title>
</head>



<body  background="images/bg3.jpg">

<a href="etracking.asp" target="_top">
<p align="center"><img src="images/line1.gif" border="0" width="73" height="33"></a>
<img src="images/line2.gif" border="0" width="64" height="33"> <img src="images/line.gif" width="307" height="33"></p>
<div align="center">
  <center>
  <table border="0" width="80">
    <tr>
      <td></td>
      <td valign="top"><img src="images/z1.jpg"><br>
        <br>
        &#30446; &#21069; &#20013; &#22269; &#22269; &#38469; &#33322; &#31354;
        &#20844; &#21496; &#20351; &#29992; &#30340; &#36135; &#36816; &#35745;
        &#31639; &#26426; &#31995; &#32479; &#24050; &#35206; &#30422; &#21271;
        &#20140; &#24066; &#36135; &#12289; &#26426; &#22330; &#36135; &#36816;
        &#12289; &#19978; &#28023; &#12289; &#24191; &#24030; &#12289; &#22823;
        &#36830; &#33829; &#19994; &#37096; &#12289; &#22825; &#27941; &#20998;
        &#20844; &#21496; &#12289; &#20197; &#21450; &#32445; &#32422; &#12289;
        &#19996; &#20140; &#12289; &#26032; &#21152; &#22369; &#12289; &#27861;
        &#20848; &#20811; &#31119; &#12289; &#32599; &#39532; &#31561; &#21150;
        &#20107; &#22788; &#65292; &#38543; &#30528; &#22806; &#31449; &#36135;
        &#36816; &#35745; &#31639; &#26426; &#31995; &#32479; &#30340; &#20351;
        &#29992; &#65292; &#36135; &#36816; &#31995; &#32479; &#20449; &#24687;
        &#36234; &#26469; &#36234; &#23436; &#21892; &#65292; &#29992; &#25143;
        &#21487; &#36890; &#36807; &#20197; &#19979; &#26041; &#24335; &#23545;
        &#36816; &#21333; &#36827; &#34892; &#26597; &#35810; &#65292; &#25484;
        &#25569; &#24744; &#30340; &#36135; &#29289; &#21435; &#21521; &#12290;
        <p><font color="#c04000"><b>&#22312; &#26597; &#35810; &#26102; &#35831;
        &#36755; &#20837; &#24744; &#30340; &#36816; &#21333; &#21495;&#65306;</b></font></p>
      </td>
    </tr>
    <tr>
      <td colspan="2">
        <form method="POST"
                   name="FrontPage_Form1"
           align="centre"
           onsubmit="return (FrontPage_Form1_Validator(this) &&
           disableButton(this))">

          <table border="1" bgcolor="#6da2e0" cellspacing="0" cellpadding="4">
            <tr>
              <th colspan="2"><font size="2">&#20004;&#23383;&#20195;&#30721;</font></th>
              <th colspan="2"><font size="2">&#36816;&#21333;&#21495;&#21069;&#32512;</font></th>
              <th colspan="2"><font size="2">&#36816;&#21333;&#21495;</font></th>
              <th nowrap><font size="2">&#30830;&#23450;&#25353;&#38062;</font></th>
            </tr>
            <tr>
              <td align="center"><font color="#800040" size="3"><em>Carrier:</em></font></td>
              <td align="center"><font color="#0000FF" size="3" face="Times New Roman"><strong>CA</strong></font></td>
              <td align="center"><font color="#800040" size="3"><em>Prefix:</em></font></td>
              <td align="center"><font color="#0000FF" size="3" face="Times New Roman"><input type="text" name="Pfx" maxlength="3" size="3" value=""></font></td>
              <td align="center" nowrap><font color="#800040" size="3"><em>Shipment:</em></font></td>
              <td align="center" nowrap>

                

                <input type="hidden" name="Carrier" value="CA">
                <p align="center"><input type="text" size="12" name="Shipment" maxlength="8" value="" align="centre" language="JavaScript" onchange="checkValidNumber()"></p>
              </td>
              <td align="center">
                <table border="0" cellspacing="1">
                  <tr>
                    <td bgcolor="#C0C0C0"><input type="Submit" value="Track">
                  </tr>
                </table>
              </td>
            </tr>
          </table>
        </form>
        <hr>
        <br>
        <img src="../../images/poweredby.png">

      </td>
    </tr>
  </table>
  </center>
</div>
</html>


<SCRIPT LANGUAGE="JavaScript">
<!--
function checkValidNumber()
{
    var number

    number =  document.forms[0].Shipment.value

    if (number.length < 8)
    {
        alert('The shipment number entered is invalid')
    }
}
//-->
</SCRIPT> 


[color=ff00ff]以下为 ../../js/tracking_func.js 文件内容[/color]
function changeButton(s)  {
//     alert("Within JS file changeButton");
    s.value = "Please Wait";
    return true;
}

function waitButton(s)  {
//     alert("Within JS file waitButton");
        if (condition==true){
           s.value="ClickToGo";
           s.disabled=false;
        }else{
           s.value="PleaseWait";
           s.disabled=true;
        }
}


function disableButton(theform) {
//    alert ("Within JS file disableButton"); 

    if (document.all || document.getElementById) {
        for (i = 0; i < theform.length; i++) {
        var tempobj = theform.elements[i];
        if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset")
        tempobj.disabled = true;
        }
    return true;
    }
}

function FrontPage_Form1_Validator_old(theForm)
{
// alert ("Within JS file FrontPage_Form1_Validator"); 
  if (theForm.Shipment.value == "")
  {
    alert("Please enter a value for the \"AWB number\" field.");
    theForm.Shipment.focus();
    return (false);
  }

  if (theForm.Shipment.value.length < 8)
  {
    alert("Please enter at least 8 numbers in the \"AWB number\" field.");
    theForm.Shipment.focus();
    return (false);
  }

  if (theForm.Shipment.value.length > 8)
  {
    alert("Please enter at most 8 numbers in the \"AWB number\" field.");
    theForm.Shipment.focus();
    return (false);
  }

  var checkOK = "0123456789-.,";
  var checkStr = theForm.Shipment.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only numbers in the \"AWB number\" field.");
    theForm.Shipment.focus();
    return (false);
  }

  if (decPoints > 1)
  {
    alert("Please enter a valid number in the \"Shipment\" field.");
    theForm.Shipment.focus();
    return (false);
  }
  return (true);
}

function FrontPage_Form1_Validator(theForm)
{

  if (theForm.Pfx.value == "")
  {
    alert("Please enter a value for the \"Prefix\" field.");
    theForm.Pfx.focus();
    return (false);
  }

  if (theForm.Pfx.value.length < 3)
  {
    alert("Please enter at least 3 numbers in the \"Prefix\" field.");
    theForm.Pfx.focus();
    return (false);
  }

  if (theForm.Pfx.value.length > 3)
  {
    alert("Please enter at most 3 numbers in the \"Prefix\" field.");
    theForm.Pfx.focus();
    return (false);
  }

  var checkOK = "0123456789-.,";
  var checkStr = theForm.Pfx.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit digits in the \"Prefix\" field.");
    theForm.Pfx.focus();
    return (false);
  }

  if (decPoints > 1)
  {
    alert("Please enter a valid number in the \"Pfx\" field.");
    theForm.Pfx.focus();
    return (false);
  }

  if (theForm.Shipment.value == "")
  {
    alert("Please enter a value for the \"AWB number\" field.");
    theForm.Shipment.focus();
    return (false);
  }

  if (theForm.Shipment.value.length < 8)
  {
    alert("Please enter at least 8 digits in the \"AWB number\" field.");
    theForm.Shipment.focus();
    return (false);
  }

  if (theForm.Shipment.value.length > 8)
  {
    alert("Please enter at most 8 digits in the \"AWB number\" field.");
    theForm.Shipment.focus();
    return (false);
  }

  var checkOK = "0123456789-.,";
  var checkStr = theForm.Shipment.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digits in the \"AWB number\" field.");
    theForm.Shipment.focus();
    return (false);
  }

  if (decPoints > 1)
  {
    alert("Please enter a valid number in the \"Shipment\" field.");
    theForm.Shipment.focus();
    return (false);
  }
  return (true);
}