S
scantor145
Excel 2002 with Visual Basic 6.3
I have an XML file, which I'll call 2SimpleSamples.xml
<?xml version="1.0"?>
<NewDataSet>
<Measurements>
<Index>0</Index>
<Pos>1</Pos>
<ChemNumber>7</ChemNumber>
<ReadNumber>1</ReadNumber>
<Repeats>0</Repeats>
<FilterNumber>1</FilterNumber>
<Signal>193075</Signal>
<Reference>76668</Reference>
<TimeStamp>1255</TimeStamp>
</Measurements>
<Measurements>
<Index>1</Index>
<Pos>1</Pos>
<ChemNumber>7</ChemNumber>
<ReadNumber>2</ReadNumber>
<Repeats>0</Repeats>
<FilterNumber>1</FilterNumber>
<Signal>191867</Signal>
<Reference>76204</Reference>
<TimeStamp>1496</TimeStamp>
</Measurements>
</NewDataSet>
In a macro I have commands to select the xml file:
Code:
--------------------
FilterList = "XML Files(*.xml),*.xml" 'Type of file to open
With Application
MyFileMod = .GetOpenFilename(filefilter:=FilterList)
End With
--------------------
In order to format the data in a prescribed way in Excel, I have
another file called 2SimpleSamples.xsl which is a style sheet
associated with the file 2Simplesamples.xml. Actually, inserting the
following line between <?xml version="1.0"?> and <NewDataSet> in the
xml file above makes the association:
<?xml-stylesheet type="text/xsl" href="2simplesamples.xsl"?>
In my macro, after I open the xml file I need to insert(write) the
above line into the xml file. Is it possible, and if so, how?
Thanks
I have an XML file, which I'll call 2SimpleSamples.xml
<?xml version="1.0"?>
<NewDataSet>
<Measurements>
<Index>0</Index>
<Pos>1</Pos>
<ChemNumber>7</ChemNumber>
<ReadNumber>1</ReadNumber>
<Repeats>0</Repeats>
<FilterNumber>1</FilterNumber>
<Signal>193075</Signal>
<Reference>76668</Reference>
<TimeStamp>1255</TimeStamp>
</Measurements>
<Measurements>
<Index>1</Index>
<Pos>1</Pos>
<ChemNumber>7</ChemNumber>
<ReadNumber>2</ReadNumber>
<Repeats>0</Repeats>
<FilterNumber>1</FilterNumber>
<Signal>191867</Signal>
<Reference>76204</Reference>
<TimeStamp>1496</TimeStamp>
</Measurements>
</NewDataSet>
In a macro I have commands to select the xml file:
Code:
--------------------
FilterList = "XML Files(*.xml),*.xml" 'Type of file to open
With Application
MyFileMod = .GetOpenFilename(filefilter:=FilterList)
End With
--------------------
In order to format the data in a prescribed way in Excel, I have
another file called 2SimpleSamples.xsl which is a style sheet
associated with the file 2Simplesamples.xml. Actually, inserting the
following line between <?xml version="1.0"?> and <NewDataSet> in the
xml file above makes the association:
<?xml-stylesheet type="text/xsl" href="2simplesamples.xsl"?>
In my macro, after I open the xml file I need to insert(write) the
above line into the xml file. Is it possible, and if so, how?
Thanks