View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
tim tim is offline
external usenet poster
 
Posts: 1
Default "XML parse error" in Excel 2003

Hello,

I'm trying to add an XML schema to an Excel 2003 workbook
using the following javascript:

<script language="JavaScript" type="text/javascript"
<!--
var xlApp;
xlApp = new ActiveXObject("Excel.Application");
xlApp.Visible = true;
xlApp.Workbooks.Add();
xlApp.Workbooks(1).XmlMaps.Add("C:\Documents and
Settings\My Documents\Office 2003\order1.xsd");
//--
</script

the last line prompts an error message "XML Parse error"
in the Internet Explorer. The file however does not seem
to be a problem at all, as when I'm manually adding the
same XSD file to Excel (via Data-XML-XML source XML
Maps..) there is absolutely no problem with the file.
An example of such a file which is a stripped down version
of Microsoft's own example from the "Using Excel 2003
Object Model to Add XML Data Integration" article is:

<?xml version="1.0" encoding="ISO-8859-1" ?
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"<xs:element
name="test"
<xs:complexType
<xs:sequence
<xs:element name="orderperson" type="xs:string"/
<xs:element name="orderperson1" type="xs:string"/
</xs:sequence
<xs:attribute name="orderid" type="xs:string"
use="required"/
</xs:complexType
</xs:element
</xs:schema



Does anyone know what the problem might be?

Thanks,
Tim