<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Excel AutoFilter и массив]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=11894&amp;type=atom" />
	<updated>2016-08-10T11:04:47Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=11894</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Excel AutoFilter и массив]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=106702#p106702" />
			<content type="html"><![CDATA[<p><strong>Drugoy</strong></p><p>Сутки угробил на эту...... Спасибо.</p>]]></content>
			<author>
				<name><![CDATA[red2881]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30934</uri>
			</author>
			<updated>2016-08-10T11:04:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=106702#p106702</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Excel AutoFilter и массив]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=106701#p106701" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>&quot;Магазин &quot; var</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Drugoy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27463</uri>
			</author>
			<updated>2016-08-10T10:59:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=106701#p106701</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Excel AutoFilter и массив]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=106699#p106699" />
			<content type="html"><![CDATA[<p>Добрый день! <br />Пытаюсь создать скрипт работающий с автофильтром в excel. Данный скрипт прекрасно работает. <br /></p><div class="codebox"><pre><code>oExcel := ComObjCreate(&quot;Excel.Application&quot;)                          
oExcel.Visible := True
xlspath = %A_Desktop%\Москва.xlsx
oExcel.Workbooks.Open(xlspath) 
sheet := oExcel.ActiveSheet
oExcel.ActiveWorkbook.Names.Item(&quot;_FilterDatabase&quot;).Delete
sheet.Range(&quot;A1:D1&quot;).AutoFilter(2, &quot;Магазин Москва&quot;)
sheet.Range(&quot;A1:D1&quot;).AutoFilter(3, &quot;=&quot;) 
oExcel.Range(&quot;A1&quot;, oExcel.Range(&quot;A1&quot;).End(-4121)).Copy
Sleep,500
FileAppend, % clipboard,  %A_Desktop%\Москва.txt 
clipboard =
oExcel.ActiveSheet.AutoFilterMode:= False
oExcel.ActiveWorkbook.Save()
oExcel.Application.Quit()
Return</code></pre></div><p>Проблема возникает с массивом в этой строке:&nbsp; &nbsp; sheet.Range(&quot;A1:D1&quot;).AutoFilter(2, &quot;Магазин %var%&quot;) <br /></p><div class="codebox"><pre><code>Array := Array(&quot;Москва&quot;,&quot;Владивосток&quot;)
 for i,var in Array
    {
oExcel := ComObjCreate(&quot;Excel.Application&quot;)                          
oExcel.Visible := True
xlspath = %A_Desktop%\%var%.xlsx
oExcel.Workbooks.Open(xlspath) 
sheet := oExcel.ActiveSheet 
oExcel.ActiveWorkbook.Names.Item(&quot;_FilterDatabase&quot;).Delete
sheet.Range(&quot;A1:D1&quot;).AutoFilter(2, &quot;Магазин %var%&quot;)      ; как сюда передать переменную 
sheet.Range(&quot;A1:D1&quot;).AutoFilter(3, &quot;=&quot;) 
oExcel.Range(&quot;A1&quot;, oExcel.Range(&quot;A1&quot;).End(-4121)).Copy
Sleep,500
FileAppend, % clipboard,  %A_Desktop%\%var%.txt 
clipboard =
oExcel.ActiveSheet.AutoFilterMode:= False
oExcel.ActiveWorkbook.Save()
oExcel.Application.Quit()
	 }
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[red2881]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30934</uri>
			</author>
			<updated>2016-08-10T08:30:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=106699#p106699</id>
		</entry>
</feed>
