导入xml文件Doctype

时间:2019-04-11 12:38:01

标签: excel xml vba

我正在VBA源代码中编程将xml文件DOCTYPE CFXML导入到excel的逻辑,但是我不知道要使用哪个函数导入。

我正在尝试此命令,但它不起作用:

ActiveWorkbook.XmlImport Url: = sFile, ImportMap: = Nothing, Overwrite: = True, Destination: = Range ("$ A $ 1")
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE CFXML [
...
<ProductLineItem>
      <ProductLineNumber>1000</ProductLineNumber>
      <TransactionType>NEW</TransactionType>
      <CPUSIUvalue>1</CPUSIUvalue>
      <ProprietaryGroupIdentifier>1000</ProprietaryGroupIdentifier>
      <Quantity>1</Quantity>
      <ProductIdentification>
        <PartnerProductIdentification>
          <OrderedProductIdentifier>N/A</OrderedProductIdentifier>
          <ProprietaryProductIdentifier>9009- 
            22A</ProprietaryProductIdentifier>
          <ProductDescription>Server 1:9009 Model 22A</ProductDescription>
          <ProductTypeCode>Hardware</ProductTypeCode>
          <ProductIdentifierTypeCode>MTM-FC</ProductIdentifierTypeCode>
        </PartnerProductIdentification>
      </ProductIdentification>
...

我要导入标签:ProductDescription,数量,MonetaryAmount,ProductTypeCode,ProprietaryProductIdentifier,ProductIdentifierTypeCode。

0 个答案:

没有答案