Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Excel 从查询URL导入结果的XML表_Excel_Xml_Vba - Fatal编程技术网

Excel 从查询URL导入结果的XML表

Excel 从查询URL导入结果的XML表,excel,xml,vba,Excel,Xml,Vba,我的工作内联网上有几个网页,用于基本查询。我们按产品ID进行查询,结果作为表格显示在页面上,并根据结果的大小进行动态调整 如果我试图直接导入查询,我确实会得到一个响应。我使用以下方式导入: With ActiveSheet.QueryTables.Add(Connection:= _ "URL;https://picture-us.MASKED.com/imaging_orders/list_data?utf8=%E2%9C%93&work_order_enum=LEGACY_W

我的工作内联网上有几个网页,用于基本查询。我们按产品ID进行查询,结果作为表格显示在页面上,并根据结果的大小进行动态调整

如果我试图直接导入查询,我确实会得到一个响应。我使用以下方式导入:

With ActiveSheet.QueryTables.Add(Connection:= _
    "URL;https://picture-us.MASKED.com/imaging_orders/list_data?utf8=%E2%9C%93&work_order_enum=LEGACY_WORK_ORDER&tab=1&asin=MASKED&warehouse=SDF8&commit_asin=Search&utf8=%E2%9C%93&work_order_enum=LEGACY_WORK_ORDER&tab=1&asin=MASKED&warehouse=SDF8&commit_asin=Search" _
    , Destination:=Range("$A$1"))
    .FieldNames = True
    .RowNumbers = False
    .FillAdjacentFormulas = False
    .PreserveFormatting = True
    .RefreshOnFileOpen = False
    .BackgroundQuery = True
    .RefreshStyle = xlInsertDeleteCells
    .SavePassword = False
    .SaveData = True
    .AdjustColumnWidth = True
    .RefreshPeriod = 0
    .WebSelectionType = xlAllTables
    .WebFormatting = xlWebFormattingNone
    .WebPreFormattedTextToColumns = True
    .WebConsecutiveDelimitersAsOne = True
    .WebSingleBlockTextImport = False
    .WebDisableDateRecognition = False
    .WebDisableRedirections = False
    .Refresh BackgroundQuery:=False
End With
我的结果如下:一个单元格中的所有内容(屏蔽以隐藏机密数据):


请编辑您的帖子并添加整个XML响应。就我所能确定的而言,这就是整个响应。如上所述,正常使用是一个内部页面,提交产品ID,并根据查询结果在该页面上生成表。如果我在浏览器中独立运行查询,上面的页面源就是生成的。如果通过excel运行查询,则在单个单元格中生成的数据与源标记相同。
<tr>
    <td style="white-space: nowrap;">
    <input type="checkbox" name="selectedOrders[]" id="selectedOrders_"   value="10040859069" />
    </td>
    <td>2019-06-25 14:06:53</td>
    <td>MASKED</td>
    <td>MASKED</td>    
    <td>COMPLETE</td>
    <td><button onclick="toggleEvents(this)" class="toggleEventButton" type="button">Show</button><br />
    <div style="display:none;" id="10040859069" class="imagingOrderEvents">
    <table>
      <thead> 
        <tr>
          <th>Date</th>
          <th>New Status</th>
          <th>User Id</th>
          <th>Module</th>
          <th>Change Reason</th>
         </tr>
       </thead> 
       <tbody> 
      </tbody>
    </table>
    </div>
    </td>
    <td>10040859069</td>
  </tr><tr>
    <td style="white-space: nowrap;">
    <input type="checkbox" name="selectedOrders[]" id="selectedOrders_" value="10043881826" />
    </td>
    <td>2019-08-20 16:36:09</td>
    <td>MASKED</td>
    <td>MASKED</td>    
    <td>COMPLETE</td>
    <td><button onclick="toggleEvents(this)" class="toggleEventButton"   type="button">Show</button><br />
    <div style="display:none;" id="10043881826" class="imagingOrderEvents">
    <table>
      <thead> 
        <tr>
          <th>Date</th>
          <th>New Status</th>
          <th>User Id</th>
          <th>Module</th>
          <th>Change Reason</th>
         </tr>
       </thead> 
       <tbody> 
      </tbody>
    </table>
    </div>
    </td>
    <td>10043881826</td>
    </tr>
    <?xml version="1.0" encoding="UTF-8" ?>
<root>
<status>
    <code>OK</code>
    <description>OK</description>
</status>
<table_body>
<![CDATA[
  <tr>
  <td style="white-space: nowrap;">
  <input type="checkbox" name="selectedOrders[]" id="selectedOrders_" value="10044295826" />
  </td>
  <td>2019-08-27 07:08:18</td>
  <td>ZZUL4SMRCB</td>
  <td>MASKED_PHOTO1</td>    
  <td>READY</td>
  <td><button onclick="toggleEvents(this)" class="toggleEventButton" type="button">Show</button><br />
  <div style="display:none;" id="10044295826" class="imagingOrderEvents">
  <table>
    <thead> 
      <tr>
        <th>Date</th>
        <th>New Status</th>
        <th>User Id</th>
        <th>Module</th>
        <th>Change Reason</th>
       </tr>
     </thead> 
     <tbody> 
    </tbody>
  </table>
  </div>
  </td>
  <td>10044295826</td>
</tr>
]]>
</table_body>
<last_page />
</root>