<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; Создание файла config.xml, используя таблицу Excel.]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=8696</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=8696&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «Создание файла config.xml, используя таблицу Excel.».]]></description>
		<lastBuildDate>Wed, 25 Sep 2013 03:08:45 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Создание файла config.xml, используя таблицу Excel.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=75543#p75543</link>
			<description><![CDATA[<p>Спасибо. Да, по учебе.</p>]]></description>
			<author><![CDATA[null@example.com (smax)]]></author>
			<pubDate>Wed, 25 Sep 2013 03:08:45 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=75543#p75543</guid>
		</item>
		<item>
			<title><![CDATA[Re: Создание файла config.xml, используя таблицу Excel.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=75533#p75533</link>
			<description><![CDATA[<p>С использованием Microsoft.XMLDOM:<br /></p><div class="codebox"><pre><code>Sub ViaXMLDOM()
    Dim XMLDoc, Cell
    Set XMLDoc = CreateObject(&quot;Microsoft.XMLDOM&quot;)
    With XMLDoc.appendchild(XMLDoc.createElement(&quot;Signals&quot;))
        For Each Cell In Range(&quot;A2:A65536&quot;)
            If Cell.Value = &quot;&quot; Then Exit For
            With .appendchild(XMLDoc.createElement(&quot;Signal&quot;))
                .setAttribute &quot;Name&quot;, Cells(Cell.Row, 1).Value
                .setAttribute &quot;Type&quot;, Cells(Cell.Row, 3).Value
                With .appendchild(XMLDoc.createElement(&quot;Properties&quot;))
                    With .appendchild(XMLDoc.createElement(&quot;Property&quot;))
                        .setAttribute &quot;Name&quot;, &quot;Description&quot;
                        .setAttribute &quot;Type&quot;, &quot;String&quot;
                        .setAttribute &quot;Value&quot;, Cells(Cell.Row, 2).Value
                    End With
                    With .appendchild(XMLDoc.createElement(&quot;Property&quot;))
                        .setAttribute &quot;Name&quot;, &quot;Address&quot;
                        .setAttribute &quot;Type&quot;, &quot;UInt&quot;
                        .setAttribute &quot;Value&quot;, Cells(Cell.Row, 4).Value
                    End With
                    If Cells(Cell.Row, 5).Value &lt;&gt; Empty Then
                        With .appendchild(XMLDoc.createElement(&quot;Property&quot;))
                        .setAttribute &quot;Name&quot;, &quot;BitPosition&quot;
                        .setAttribute &quot;Type&quot;, &quot;Byte&quot;
                        .setAttribute &quot;Value&quot;, Cells(Cell.Row, 5).Value
                        End With
                    End If
                End With
            End With
        Next
    End With
    XMLDoc.Save ThisWorkbook.Path &amp; &quot;\config.xml&quot;
    Set XMLDoc = Nothing
    MsgBox &quot;Saved to &quot; &amp; ThisWorkbook.Path &amp; &quot;\config.xml&quot;
End Sub</code></pre></div><p>И кустарным методом:<br /></p><div class="codebox"><pre><code>Sub HandyCraft()
    Dim Cell, XMLText
    XMLText = &quot;&lt;Signals&gt;&quot; &amp; vbCrLf
    For Each Cell In Range(&quot;A2:A65536&quot;)
        If Cell.Value = &quot;&quot; Then Exit For
        XMLText = XMLText &amp; vbTab &amp; &quot;&lt;Signal Name=&quot;&quot;&quot; &amp; Cells(Cell.Row, 1).Value &amp; &quot;&quot;&quot; Type=&quot;&quot;&quot; &amp; Cells(Cell.Row, 3).Value &amp; &quot;&quot;&quot;&gt;&quot; &amp; vbCrLf &amp; vbTab &amp; vbTab &amp; &quot;&lt;Properties&gt;&quot; &amp; vbCrLf
        XMLText = XMLText &amp; vbTab &amp; vbTab &amp; vbTab &amp; &quot;&lt;Property Name=&quot;&quot;Description&quot;&quot; Type=&quot;&quot;String&quot;&quot; Value=&quot;&quot;&quot; &amp; Cells(Cell.Row, 2).Value &amp; &quot;&quot;&quot; /&gt;&quot; &amp; vbCrLf
        XMLText = XMLText &amp; vbTab &amp; vbTab &amp; vbTab &amp; &quot;&lt;Property Name=&quot;&quot;Address&quot;&quot; Type=&quot;&quot;UInt&quot;&quot; Value=&quot;&quot;&quot; &amp; Cells(Cell.Row, 4).Value &amp; &quot;&quot;&quot; /&gt;&quot; &amp; vbCrLf
        If Cells(Cell.Row, 5).Value &lt;&gt; Empty Then XMLText = XMLText &amp; vbTab &amp; vbTab &amp; vbTab &amp; &quot;&lt;Property Name=&quot;&quot;BitPosition&quot;&quot; Type=&quot;&quot;Byte&quot;&quot; Value=&quot;&quot;&quot; &amp; Cells(Cell.Row, 5).Value &amp; &quot;&quot;&quot; /&gt;&quot; &amp; vbCrLf
        XMLText = XMLText &amp; vbTab &amp; vbTab &amp; &quot;&lt;/Properties&gt;&quot; &amp; vbCrLf &amp; vbTab &amp; &quot;&lt;/Signal&gt;&quot; &amp; vbCrLf
    Next
    XMLText = XMLText &amp; &quot;&lt;/Signals&gt;&quot; &amp; vbCrLf
    With CreateObject(&quot;Scripting.FileSystemObject&quot;).CreateTextFile(ThisWorkbook.Path &amp; &quot;\config.xml&quot;, True)
        .Write (XMLText)
        .Close
    End With
    MsgBox &quot;Saved to &quot; &amp; ThisWorkbook.Path &amp; &quot;\config.xml&quot;
End Sub</code></pre></div><p><strong>smax</strong>, раскройте секрет,&nbsp; что за тесты?</p>]]></description>
			<author><![CDATA[null@example.com (omegastripes)]]></author>
			<pubDate>Tue, 24 Sep 2013 19:54:32 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=75533#p75533</guid>
		</item>
		<item>
			<title><![CDATA[Создание файла config.xml, используя таблицу Excel.]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=75524#p75524</link>
			<description><![CDATA[<p>Будьте добры, помогите. <br />Мне нужно написать скрипт VBA, который будет создавать файлик config.xml следующего формата, использую таблицу из excel.</p><p>Формат готового файла.<br />&lt;Signals&gt;<br />&lt;Signal Name=&quot;ZDV1_Open&quot; Type=&quot;Bool&quot;&gt;<br />&lt;Properties&gt;<br />&lt;Property Name=&quot;Description&quot; Type=&quot;String&quot; Value=&quot;Задвижка 1 - открыта&quot; /&gt;<br />&lt;Property Name=&quot;Address&quot; Type=&quot;UInt&quot; Value=&quot;4001&quot; /&gt;<br />&lt;Property Name=&quot;BitPosition&quot; Type=&quot;Byte&quot; Value=&quot;0&quot; /&gt;<br />&lt;/Properties&gt;<br />&lt;/Signal&gt;<br />&lt;Signal Name=&quot;ZDV1_Close&quot; Type=&quot;Bool&quot;&gt;<br />&lt;Properties&gt;<br />&lt;Property Name=&quot;Description&quot; Type=&quot;String&quot; Value=&quot;Задвижка 1 - закрыта&quot; /&gt;<br />&lt;Property Name=&quot;Address&quot; Type=&quot;UInt&quot; Value=&quot;4001&quot; /&gt;<br />&lt;Property Name=&quot;BitPosition&quot; Type=&quot;Byte&quot; Value=&quot;1&quot; /&gt;<br />&lt;/Properties&gt;<br />&lt;/Signal&gt;<br />&lt;Signal Name=&quot;ZDV2_Open&quot; Type=&quot;Bool&quot;&gt;<br />&lt;Properties&gt;<br />&lt;Property Name=&quot;Description&quot; Type=&quot;String&quot; Value=&quot;Задвижка 2 - открыта&quot; /&gt;<br />&lt;Property Name=&quot;Address&quot; Type=&quot;UInt&quot; Value=&quot;4001&quot; /&gt;<br />&lt;Property Name=&quot;BitPosition&quot; Type=&quot;Byte&quot; Value=&quot;2&quot; /&gt;<br />&lt;/Properties&gt;<br />&lt;/Signal&gt;<br />&lt;Signal Name=&quot;ZDV2_Close&quot; Type=&quot;Bool&quot;&gt;<br />&lt;Properties&gt;<br />&lt;Property Name=&quot;Description&quot; Type=&quot;String&quot; Value=&quot;Задвижка 2 - закрыта&quot; /&gt;<br />&lt;Property Name=&quot;Address&quot; Type=&quot;UInt&quot; Value=&quot;4001&quot; /&gt;<br />&lt;Property Name=&quot;BitPosition&quot; Type=&quot;Byte&quot; Value=&quot;3&quot; /&gt;<br />&lt;/Properties&gt;<br />&lt;/Signal&gt;<br />&lt;Signal Name=&quot;RES21_Temp&quot; Type=&quot;Float&quot;&gt;<br />&lt;Properties&gt;<br />&lt;Property Name=&quot;Description&quot; Type=&quot;String&quot; Value=&quot;Температура в резервуаре 21&quot; /&gt;<br />&lt;Property Name=&quot;Address&quot; Type=&quot;UInt&quot; Value=&quot;4100&quot; /&gt;<br />&lt;/Properties&gt;<br />&lt;/Signal&gt;<br />&lt;Signal Name=&quot;RES21_Level&quot; Type=&quot;Float&quot;&gt;<br />&lt;Properties&gt;<br />&lt;Property Name=&quot;Description&quot; Type=&quot;String&quot; Value=&quot;Уровень в резервуаре 21&quot; /&gt;<br />&lt;Property Name=&quot;Address&quot; Type=&quot;UInt&quot; Value=&quot;4101&quot; /&gt;<br />&lt;/Properties&gt;<br />&lt;/Signal&gt;<br />&lt;Signal Name=&quot;RES21_Speed&quot; Type=&quot;Float&quot;&gt;<br />&lt;Properties&gt;<br />&lt;Property Name=&quot;Description&quot; Type=&quot;String&quot; Value=&quot;Скорость наполнения в резервуаре 21&quot; /&gt;<br />&lt;Property Name=&quot;Address&quot; Type=&quot;UInt&quot; Value=&quot;4102&quot; /&gt;<br />&lt;/Properties&gt;<br />&lt;/Signal&gt;<br />&lt;/Signals&gt;</p>]]></description>
			<author><![CDATA[null@example.com (smax)]]></author>
			<pubDate>Tue, 24 Sep 2013 08:15:45 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=75524#p75524</guid>
		</item>
	</channel>
</rss>
