<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Fixing Matlab&#039;s actxserver	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/fixing-matlabs-actxserver/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/fixing-matlabs-actxserver?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fixing-matlabs-actxserver</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Fri, 27 May 2022 09:28:03 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.3</generator>
	<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/fixing-matlabs-actxserver#comment-514164</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Fri, 27 May 2022 09:28:03 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3416#comment-514164</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/fixing-matlabs-actxserver#comment-513851&quot;&gt;Ren&lt;/a&gt;.

Ren - This is usually the expected behavior, which avoids unnecessary duplications of the Excel process in CPU/memory. If you want to kill the process you can always run &lt;code&gt;system(&#039;taskkill /im excel.exe 2&gt; NUL&#039;)&lt;/code&gt; or  &lt;code&gt;hExcel.Quit; delete(hExcel)&lt;/code&gt;. (the delete(hExcel) part is important - without it the process will not actually quit).]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/fixing-matlabs-actxserver#comment-513851">Ren</a>.</p>
<p>Ren &#8211; This is usually the expected behavior, which avoids unnecessary duplications of the Excel process in CPU/memory. If you want to kill the process you can always run <code>system('taskkill /im excel.exe 2> NUL')</code> or  <code>hExcel.Quit; delete(hExcel)</code>. (the delete(hExcel) part is important &#8211; without it the process will not actually quit).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ren		</title>
		<link>https://undocumentedmatlab.com/articles/fixing-matlabs-actxserver#comment-513851</link>

		<dc:creator><![CDATA[Ren]]></dc:creator>
		<pubDate>Sun, 03 Apr 2022 15:38:32 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3416#comment-513851</guid>

					<description><![CDATA[I noticed that xlsread will create a hidden and never-dying special server that always has priority when actxGetRunningServer is called.
So this cause a problem that no matter how many servers I re-create, the actxGetRunningServer is always connected to the hidden xlsread-generated server, which never dies even when I change the raw code by adding a Excel.Quit() to the private file of Matlab.]]></description>
			<content:encoded><![CDATA[<p>I noticed that xlsread will create a hidden and never-dying special server that always has priority when actxGetRunningServer is called.<br />
So this cause a problem that no matter how many servers I re-create, the actxGetRunningServer is always connected to the hidden xlsread-generated server, which never dies even when I change the raw code by adding a Excel.Quit() to the private file of Matlab.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sarunas		</title>
		<link>https://undocumentedmatlab.com/articles/fixing-matlabs-actxserver#comment-418426</link>

		<dc:creator><![CDATA[Sarunas]]></dc:creator>
		<pubDate>Thu, 11 Jan 2018 14:55:08 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3416#comment-418426</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/fixing-matlabs-actxserver#comment-418217&quot;&gt;Sarunas&lt;/a&gt;.

Update:

Since &quot;the one&quot; used instance of EXCEL is closed inside other called functions (like xlsread/xlswrite), I had to hide some of the code there to prevent the programs from closing. I use readtable, which works good with this xlsread correction, but writetable has another Excel.Quit line, which I managed to find in write.m file. I disabled a few lines in writeXLSFile (which is called from within write.m), but not sure if they are of any significance, because my problem was fixed eventually after editing the write.m file. This however means that I will have to manually control the behaviour of how EXCEL workbooks are displayed, but this way my run-time was reduced from ~90 s to ~20 s.

HOWEVER, once compiled to an .exe, program seems to have a problem using actxGetRunningServer.m, which is the core to this &#039;fix&#039;. This meant that I had to change back all the functions to compile a version that&#039;s usable with MCR. 

At least I learnt something in the process. And even though my users get no merits from this, I will definitely use those fixes if I happen read/write hundreds of excel files again.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/fixing-matlabs-actxserver#comment-418217">Sarunas</a>.</p>
<p>Update:</p>
<p>Since &#8220;the one&#8221; used instance of EXCEL is closed inside other called functions (like xlsread/xlswrite), I had to hide some of the code there to prevent the programs from closing. I use readtable, which works good with this xlsread correction, but writetable has another Excel.Quit line, which I managed to find in write.m file. I disabled a few lines in writeXLSFile (which is called from within write.m), but not sure if they are of any significance, because my problem was fixed eventually after editing the write.m file. This however means that I will have to manually control the behaviour of how EXCEL workbooks are displayed, but this way my run-time was reduced from ~90 s to ~20 s.</p>
<p>HOWEVER, once compiled to an .exe, program seems to have a problem using actxGetRunningServer.m, which is the core to this &#8216;fix&#8217;. This meant that I had to change back all the functions to compile a version that&#8217;s usable with MCR. </p>
<p>At least I learnt something in the process. And even though my users get no merits from this, I will definitely use those fixes if I happen read/write hundreds of excel files again.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sarunas		</title>
		<link>https://undocumentedmatlab.com/articles/fixing-matlabs-actxserver#comment-418222</link>

		<dc:creator><![CDATA[Sarunas]]></dc:creator>
		<pubDate>Wed, 03 Jan 2018 09:16:31 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3416#comment-418222</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/fixing-matlabs-actxserver#comment-418217&quot;&gt;Sarunas&lt;/a&gt;.

Or maybe I was too joyful too quickly.

Apparently if there is an excel window open, I get an error and/or the window is closed.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/fixing-matlabs-actxserver#comment-418217">Sarunas</a>.</p>
<p>Or maybe I was too joyful too quickly.</p>
<p>Apparently if there is an excel window open, I get an error and/or the window is closed.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sarunas		</title>
		<link>https://undocumentedmatlab.com/articles/fixing-matlabs-actxserver#comment-418217</link>

		<dc:creator><![CDATA[Sarunas]]></dc:creator>
		<pubDate>Wed, 03 Jan 2018 07:38:17 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3416#comment-418217</guid>

					<description><![CDATA[I had a program that reads two excel files (== two tables) and returns an excel with 10 sheets, 2 - 3 tables each sheet. I used WRITETABLE, I had to use that for every table, making the program a bit slow. 

Even more, when I had to calculate hundreds of input file variation combinations, the run-time started slowing down progressively. This was due to the fact, that EXCEL instances were opened for each call to read/write EXCEL files, and they, not closing before the following loop, started stacking up. I solved this by closing all EXCEL instances after each reference to EXCEL files, side effect being not being able to use EXCEL while running the program (which I was too lazy to solve).

After implementing the try/catch posted here into actxserver.m, the program runs twice as fast without the side effect. Thank you kind sir.]]></description>
			<content:encoded><![CDATA[<p>I had a program that reads two excel files (== two tables) and returns an excel with 10 sheets, 2 &#8211; 3 tables each sheet. I used WRITETABLE, I had to use that for every table, making the program a bit slow. </p>
<p>Even more, when I had to calculate hundreds of input file variation combinations, the run-time started slowing down progressively. This was due to the fact, that EXCEL instances were opened for each call to read/write EXCEL files, and they, not closing before the following loop, started stacking up. I solved this by closing all EXCEL instances after each reference to EXCEL files, side effect being not being able to use EXCEL while running the program (which I was too lazy to solve).</p>
<p>After implementing the try/catch posted here into actxserver.m, the program runs twice as fast without the side effect. Thank you kind sir.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: duke		</title>
		<link>https://undocumentedmatlab.com/articles/fixing-matlabs-actxserver#comment-373763</link>

		<dc:creator><![CDATA[duke]]></dc:creator>
		<pubDate>Tue, 05 Apr 2016 18:26:25 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3416#comment-373763</guid>

					<description><![CDATA[doesn&#039;t work, crashes out.]]></description>
			<content:encoded><![CDATA[<p>doesn&#8217;t work, crashes out.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/fixing-matlabs-actxserver#comment-328070</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Fri, 18 Jul 2014 08:15:49 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3416#comment-328070</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/fixing-matlabs-actxserver#comment-328021&quot;&gt;liam&lt;/a&gt;.

@Liam - I&#039;m not aware of a way to do this.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/fixing-matlabs-actxserver#comment-328021">liam</a>.</p>
<p>@Liam &#8211; I&#8217;m not aware of a way to do this.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: liam		</title>
		<link>https://undocumentedmatlab.com/articles/fixing-matlabs-actxserver#comment-328021</link>

		<dc:creator><![CDATA[liam]]></dc:creator>
		<pubDate>Thu, 17 Jul 2014 15:44:40 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3416#comment-328021</guid>

					<description><![CDATA[Is there a way to force actxserver to create two separate instances. 

I have been trying to launch to separate COM instance of CQG COM object by calling  actxserver(&#039;CQG.CQGCEL.4&#039;) twice. This will only return one instance of the actxserver.

Is there a way to force 2 instances?

Tks]]></description>
			<content:encoded><![CDATA[<p>Is there a way to force actxserver to create two separate instances. </p>
<p>I have been trying to launch to separate COM instance of CQG COM object by calling  actxserver(&#8216;CQG.CQGCEL.4&#8217;) twice. This will only return one instance of the actxserver.</p>
<p>Is there a way to force 2 instances?</p>
<p>Tks</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
