<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238320</link>
    <title>MATLAB Central Newsreader - excel matlab connection and execution</title>
    <description>Feed for thread: excel matlab connection and execution</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 28 Oct 2008 21:18:02 -0400</pubDate>
      <title>excel matlab connection and execution</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238320#607783</link>
      <author>Filip T?rnqvist</author>
      <description>Hello!&lt;br&gt;
&lt;br&gt;
We're trying to connect and run matlab from excel using a subroutine(executed via a commandbutton in excel) with the following visualbasic code:&lt;br&gt;
&lt;br&gt;
Sub Exc_to_Mat()&lt;br&gt;
&lt;br&gt;
Dim MatLab As Object&lt;br&gt;
Dim result As String&lt;br&gt;
Dim MReal() As Double&lt;br&gt;
Dim MImag() As Double&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;br&gt;
Set MatLab = CreateObject(&quot;Matlab.Application&quot;)&lt;br&gt;
&lt;br&gt;
Call MatLab.Execute(&quot;clear all&quot;)&lt;br&gt;
Call MatLab.Execute(&quot;cd C:\My_Docs\Kurser_T\ProduktModellering_TMKT57\Excel_Matlab&quot;)&lt;br&gt;
Call MatLab.Execute(&quot;test1([ &quot; &amp; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C5&quot;).Value _&lt;br&gt;
&amp; &quot; &quot; &amp; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C6&quot;).Value _&lt;br&gt;
&amp; &quot; &quot; &amp; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C7&quot;).Value &amp; &quot;])&quot;)&lt;br&gt;
Call MatLab.Execute(&quot;ans&quot;)&lt;br&gt;
&lt;br&gt;
Call MatLab.GetFullMatrix(&quot;ans&quot;, &quot;base&quot;, MReal, MImag)&lt;br&gt;
&lt;br&gt;
ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;Stress&quot;).Value = MReal&lt;br&gt;
&lt;br&gt;
End Sub&lt;br&gt;
&lt;br&gt;
Running the m-file called test1 which looks like this:&lt;br&gt;
&lt;br&gt;
function Stress= test1(x);&lt;br&gt;
Radius = x(1);&lt;br&gt;
Thickness = x(2);&lt;br&gt;
Pressure = x(3);&lt;br&gt;
Stress = Pressure*Radius/Thickness;&lt;br&gt;
&lt;br&gt;
This connection will work and run on a computer using the 2006b licens but not a computer using the 2007a what might be the problem? Have we forgotten to add references in excel in order to be able to run these types o files? Or have the possibility to run these types of codes been removed from the 2007 version?&lt;br&gt;
&lt;br&gt;
Best regards &lt;br&gt;
/Filip and Oskar</description>
    </item>
    <item>
      <pubDate>Tue, 28 Oct 2008 22:11:14 -0400</pubDate>
      <title>Re: excel matlab connection and execution</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238320#607796</link>
      <author>Ashish Uthama</author>
      <description>Excel uses the registry to obtain the path/version of MATLAB to use for  &lt;br&gt;
this command:&lt;br&gt;
&amp;gt; Set MatLab = CreateObject(&quot;Matlab.Application&quot;)&lt;br&gt;
Only one version of MATLAB may be registered using this per computer.&lt;br&gt;
&lt;br&gt;
To ensure that MATLAB is registered and is indeed in the registry for  &lt;br&gt;
Excel to find, do this:&lt;br&gt;
&lt;br&gt;
1. Open the version of MATLAB you would like to use&lt;br&gt;
2. type this in thecommand window:&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;matlab -regserver&lt;br&gt;
3. Type 'exit' in the new MATLAB command window that opens.&lt;br&gt;
4. Close the main MATLAB session&lt;br&gt;
5. Try your excel app..&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
On Tue, 28 Oct 2008 17:18:02 -0400, Filip T?rnqvist  &lt;br&gt;
&amp;lt;filto338@student.liu.se&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt; Hello!&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; We're trying to connect and run matlab from excel using a  &lt;br&gt;
&amp;gt; subroutine(executed via a commandbutton in excel) with the following  &lt;br&gt;
&amp;gt; visualbasic code:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Sub Exc_to_Mat()&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Dim MatLab As Object&lt;br&gt;
&amp;gt; Dim result As String&lt;br&gt;
&amp;gt; Dim MReal() As Double&lt;br&gt;
&amp;gt; Dim MImag() As Double&lt;br&gt;
&amp;gt; Set MatLab = CreateObject(&quot;Matlab.Application&quot;)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Call MatLab.Execute(&quot;clear all&quot;)&lt;br&gt;
&amp;gt; Call MatLab.Execute(&quot;cd  &lt;br&gt;
&amp;gt; C:\My_Docs\Kurser_T\ProduktModellering_TMKT57\Excel_Matlab&quot;)&lt;br&gt;
&amp;gt; Call MatLab.Execute(&quot;test1([ &quot; &amp;  &lt;br&gt;
&amp;gt; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C5&quot;).Value _&lt;br&gt;
&amp;gt; &amp; &quot; &quot; &amp; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C6&quot;).Value _&lt;br&gt;
&amp;gt; &amp; &quot; &quot; &amp; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C7&quot;).Value &amp; &quot;])&quot;)&lt;br&gt;
&amp;gt; Call MatLab.Execute(&quot;ans&quot;)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Call MatLab.GetFullMatrix(&quot;ans&quot;, &quot;base&quot;, MReal, MImag)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;Stress&quot;).Value = MReal&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; End Sub&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Running the m-file called test1 which looks like this:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; function Stress= test1(x);&lt;br&gt;
&amp;gt; Radius = x(1);&lt;br&gt;
&amp;gt; Thickness = x(2);&lt;br&gt;
&amp;gt; Pressure = x(3);&lt;br&gt;
&amp;gt; Stress = Pressure*Radius/Thickness;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; This connection will work and run on a computer using the 2006b licens  &lt;br&gt;
&amp;gt; but not a computer using the 2007a what might be the problem? Have we  &lt;br&gt;
&amp;gt; forgotten to add references in excel in order to be able to run these  &lt;br&gt;
&amp;gt; types o files? Or have the possibility to run these types of codes been  &lt;br&gt;
&amp;gt; removed from the 2007 version?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Best regards&lt;br&gt;
&amp;gt; /Filip and Oskar</description>
    </item>
    <item>
      <pubDate>Wed, 29 Oct 2008 07:32:01 -0400</pubDate>
      <title>Re: excel matlab connection and execution</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238320#607845</link>
      <author>Filip T?rnqvist</author>
      <description>We just tried this and matlab refuses to accept the command&lt;br&gt;
matlab -regserver in the main window. We only get a message saying undefined function or variable.&lt;br&gt;
&lt;br&gt;
Best regards &lt;br&gt;
/Filip and Oskar&lt;br&gt;
&lt;br&gt;
&quot;Ashish Uthama&quot; &amp;lt;first.last@mathworks.com&amp;gt; wrote in message &amp;lt;op.ujq880pha5ziv5@uthamaa.dhcp.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Excel uses the registry to obtain the path/version of MATLAB to use for  &lt;br&gt;
&amp;gt; this command:&lt;br&gt;
&amp;gt; &amp;gt; Set MatLab = CreateObject(&quot;Matlab.Application&quot;)&lt;br&gt;
&amp;gt; Only one version of MATLAB may be registered using this per computer.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; To ensure that MATLAB is registered and is indeed in the registry for  &lt;br&gt;
&amp;gt; Excel to find, do this:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 1. Open the version of MATLAB you would like to use&lt;br&gt;
&amp;gt; 2. type this in thecommand window:&lt;br&gt;
&amp;gt;      matlab -regserver&lt;br&gt;
&amp;gt; 3. Type 'exit' in the new MATLAB command window that opens.&lt;br&gt;
&amp;gt; 4. Close the main MATLAB session&lt;br&gt;
&amp;gt; 5. Try your excel app..&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; On Tue, 28 Oct 2008 17:18:02 -0400, Filip T?rnqvist  &lt;br&gt;
&amp;gt; &amp;lt;filto338@student.liu.se&amp;gt; wrote:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Hello!&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; We're trying to connect and run matlab from excel using a  &lt;br&gt;
&amp;gt; &amp;gt; subroutine(executed via a commandbutton in excel) with the following  &lt;br&gt;
&amp;gt; &amp;gt; visualbasic code:&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Sub Exc_to_Mat()&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Dim MatLab As Object&lt;br&gt;
&amp;gt; &amp;gt; Dim result As String&lt;br&gt;
&amp;gt; &amp;gt; Dim MReal() As Double&lt;br&gt;
&amp;gt; &amp;gt; Dim MImag() As Double&lt;br&gt;
&amp;gt; &amp;gt; Set MatLab = CreateObject(&quot;Matlab.Application&quot;)&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Call MatLab.Execute(&quot;clear all&quot;)&lt;br&gt;
&amp;gt; &amp;gt; Call MatLab.Execute(&quot;cd  &lt;br&gt;
&amp;gt; &amp;gt; C:\My_Docs\Kurser_T\ProduktModellering_TMKT57\Excel_Matlab&quot;)&lt;br&gt;
&amp;gt; &amp;gt; Call MatLab.Execute(&quot;test1([ &quot; &amp;  &lt;br&gt;
&amp;gt; &amp;gt; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C5&quot;).Value _&lt;br&gt;
&amp;gt; &amp;gt; &amp; &quot; &quot; &amp; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C6&quot;).Value _&lt;br&gt;
&amp;gt; &amp;gt; &amp; &quot; &quot; &amp; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C7&quot;).Value &amp; &quot;])&quot;)&lt;br&gt;
&amp;gt; &amp;gt; Call MatLab.Execute(&quot;ans&quot;)&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Call MatLab.GetFullMatrix(&quot;ans&quot;, &quot;base&quot;, MReal, MImag)&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;Stress&quot;).Value = MReal&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; End Sub&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Running the m-file called test1 which looks like this:&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; function Stress= test1(x);&lt;br&gt;
&amp;gt; &amp;gt; Radius = x(1);&lt;br&gt;
&amp;gt; &amp;gt; Thickness = x(2);&lt;br&gt;
&amp;gt; &amp;gt; Pressure = x(3);&lt;br&gt;
&amp;gt; &amp;gt; Stress = Pressure*Radius/Thickness;&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; This connection will work and run on a computer using the 2006b licens  &lt;br&gt;
&amp;gt; &amp;gt; but not a computer using the 2007a what might be the problem? Have we  &lt;br&gt;
&amp;gt; &amp;gt; forgotten to add references in excel in order to be able to run these  &lt;br&gt;
&amp;gt; &amp;gt; types o files? Or have the possibility to run these types of codes been  &lt;br&gt;
&amp;gt; &amp;gt; removed from the 2007 version?&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Best regards&lt;br&gt;
&amp;gt; &amp;gt; /Filip and Oskar</description>
    </item>
    <item>
      <pubDate>Wed, 29 Oct 2008 09:39:01 -0400</pubDate>
      <title>Re: excel matlab connection and execution</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238320#607855</link>
      <author>Filip T?rnqvist</author>
      <description>Do you mean the windows commandwindow or the matlab one?&lt;br&gt;
If we run the VB code we only get 65535 as the result. Eventhough we do send something else.&lt;br&gt;
&lt;br&gt;
Best regards&lt;br&gt;
/Filip and Oskar&lt;br&gt;
&lt;br&gt;
&quot;Filip T?rnqvist&quot; &amp;lt;filto338@student.liu.se&amp;gt; wrote in message &amp;lt;ge7via$ogo$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hello!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; We're trying to connect and run matlab from excel using a subroutine(executed via a commandbutton in excel) with the following visualbasic code:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Sub Exc_to_Mat()&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Dim MatLab As Object&lt;br&gt;
&amp;gt; Dim result As String&lt;br&gt;
&amp;gt; Dim MReal() As Double&lt;br&gt;
&amp;gt; Dim MImag() As Double&lt;br&gt;
&amp;gt;   &lt;br&gt;
&amp;gt; Set MatLab = CreateObject(&quot;Matlab.Application&quot;)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Call MatLab.Execute(&quot;clear all&quot;)&lt;br&gt;
&amp;gt; Call MatLab.Execute(&quot;cd C:\My_Docs\Kurser_T\ProduktModellering_TMKT57\Excel_Matlab&quot;)&lt;br&gt;
&amp;gt; Call MatLab.Execute(&quot;test1([ &quot; &amp; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C5&quot;).Value _&lt;br&gt;
&amp;gt; &amp; &quot; &quot; &amp; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C6&quot;).Value _&lt;br&gt;
&amp;gt; &amp; &quot; &quot; &amp; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C7&quot;).Value &amp; &quot;])&quot;)&lt;br&gt;
&amp;gt; Call MatLab.Execute(&quot;ans&quot;)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Call MatLab.GetFullMatrix(&quot;ans&quot;, &quot;base&quot;, MReal, MImag)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;Stress&quot;).Value = MReal&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; End Sub&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Running the m-file called test1 which looks like this:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; function Stress= test1(x);&lt;br&gt;
&amp;gt; Radius = x(1);&lt;br&gt;
&amp;gt; Thickness = x(2);&lt;br&gt;
&amp;gt; Pressure = x(3);&lt;br&gt;
&amp;gt; Stress = Pressure*Radius/Thickness;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; This connection will work and run on a computer using the 2006b licens but not a computer using the 2007a what might be the problem? Have we forgotten to add references in excel in order to be able to run these types o files? Or have the possibility to run these types of codes been removed from the 2007 version?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Best regards &lt;br&gt;
&amp;gt; /Filip and Oskar</description>
    </item>
    <item>
      <pubDate>Wed, 29 Oct 2008 12:32:25 -0400</pubDate>
      <title>Re: excel matlab connection and execution</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238320#607881</link>
      <author>Ashish Uthama</author>
      <description>apologies&lt;br&gt;
I forgot the '!'&lt;br&gt;
try this in the MATLAB command window:&lt;br&gt;
matlabprompt&amp;gt;!matlab -regserver&lt;br&gt;
&lt;br&gt;
You can also look at (explains how to do this from the windows command  &lt;br&gt;
prompt):&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/support/solutions/data/1-S09OT.html?solution=1-S09OT&quot;&gt;http://www.mathworks.com/support/solutions/data/1-S09OT.html?solution=1-S09OT&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
On Wed, 29 Oct 2008 03:32:01 -0400, Filip T?rnqvist  &lt;br&gt;
&amp;lt;filto338@student.liu.se&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt; We just tried this and matlab refuses to accept the command&lt;br&gt;
&amp;gt; matlab -regserver in the main window. We only get a message saying  &lt;br&gt;
&amp;gt; undefined function or variable.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Best regards&lt;br&gt;
&amp;gt; /Filip and Oskar&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &quot;Ashish Uthama&quot; &amp;lt;first.last@mathworks.com&amp;gt; wrote in message  &lt;br&gt;
&amp;gt; &amp;lt;op.ujq880pha5ziv5@uthamaa.dhcp.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt;&amp;gt; Excel uses the registry to obtain the path/version of MATLAB to use for&lt;br&gt;
&amp;gt;&amp;gt; this command:&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Set MatLab = CreateObject(&quot;Matlab.Application&quot;)&lt;br&gt;
&amp;gt;&amp;gt; Only one version of MATLAB may be registered using this per computer.&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; To ensure that MATLAB is registered and is indeed in the registry for&lt;br&gt;
&amp;gt;&amp;gt; Excel to find, do this:&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; 1. Open the version of MATLAB you would like to use&lt;br&gt;
&amp;gt;&amp;gt; 2. type this in thecommand window:&lt;br&gt;
&amp;gt;&amp;gt;      matlab -regserver&lt;br&gt;
&amp;gt;&amp;gt; 3. Type 'exit' in the new MATLAB command window that opens.&lt;br&gt;
&amp;gt;&amp;gt; 4. Close the main MATLAB session&lt;br&gt;
&amp;gt;&amp;gt; 5. Try your excel app..&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; On Tue, 28 Oct 2008 17:18:02 -0400, Filip T?rnqvist&lt;br&gt;
&amp;gt;&amp;gt; &amp;lt;filto338@student.liu.se&amp;gt; wrote:&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Hello!&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; We're trying to connect and run matlab from excel using a&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; subroutine(executed via a commandbutton in excel) with the following&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; visualbasic code:&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Sub Exc_to_Mat()&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Dim MatLab As Object&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Dim result As String&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Dim MReal() As Double&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Dim MImag() As Double&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Set MatLab = CreateObject(&quot;Matlab.Application&quot;)&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Call MatLab.Execute(&quot;clear all&quot;)&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Call MatLab.Execute(&quot;cd&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; C:\My_Docs\Kurser_T\ProduktModellering_TMKT57\Excel_Matlab&quot;)&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Call MatLab.Execute(&quot;test1([ &quot; &amp;&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C5&quot;).Value _&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; &amp; &quot; &quot; &amp; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C6&quot;).Value _&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; &amp; &quot; &quot; &amp; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C7&quot;).Value &amp; &quot;])&quot;)&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Call MatLab.Execute(&quot;ans&quot;)&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Call MatLab.GetFullMatrix(&quot;ans&quot;, &quot;base&quot;, MReal, MImag)&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;Stress&quot;).Value = MReal&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; End Sub&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Running the m-file called test1 which looks like this:&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; function Stress= test1(x);&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Radius = x(1);&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Thickness = x(2);&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Pressure = x(3);&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Stress = Pressure*Radius/Thickness;&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; This connection will work and run on a computer using the 2006b licens&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; but not a computer using the 2007a what might be the problem? Have we&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; forgotten to add references in excel in order to be able to run these&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; types o files? Or have the possibility to run these types of codes  &lt;br&gt;
&amp;gt;&amp;gt; been&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; removed from the 2007 version?&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; Best regards&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt; /Filip and Oskar&lt;br&gt;
&amp;gt;</description>
    </item>
    <item>
      <pubDate>Wed, 29 Oct 2008 17:09:01 -0400</pubDate>
      <title>Re: excel matlab connection and execution</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238320#607925</link>
      <author>Ben Hinchliffe</author>
      <description>Hi Filip and Oskar,&lt;br&gt;
You may want to try using an add-in for Excel and Word called Inference for MATLAB.  Inference enables you to combine MATLAB commands, MATLAB software objects, data, and text within an Excel or Word document.  This document can then be executed to generate a results document (report). &lt;br&gt;
By using Inference, you can avoid the hassle of visualbasic and working with the Office object model.&lt;br&gt;
You can download a free 120-day trial of Inference for MATLAB at www.InferenceForMATLAB.com&lt;br&gt;
Hope this helps!&lt;br&gt;
-Ben&lt;br&gt;
&lt;br&gt;
&quot;Filip T?rnqvist&quot; &amp;lt;filto338@student.liu.se&amp;gt; wrote in message &amp;lt;ge9avl$8g2$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Do you mean the windows commandwindow or the matlab one?&lt;br&gt;
&amp;gt; If we run the VB code we only get 65535 as the result. Eventhough we do send something else.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Best regards&lt;br&gt;
&amp;gt; /Filip and Oskar&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Filip T?rnqvist&quot; &amp;lt;filto338@student.liu.se&amp;gt; wrote in message &amp;lt;ge7via$ogo$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Hello!&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; We're trying to connect and run matlab from excel using a subroutine(executed via a commandbutton in excel) with the following visualbasic code:&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Sub Exc_to_Mat()&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Dim MatLab As Object&lt;br&gt;
&amp;gt; &amp;gt; Dim result As String&lt;br&gt;
&amp;gt; &amp;gt; Dim MReal() As Double&lt;br&gt;
&amp;gt; &amp;gt; Dim MImag() As Double&lt;br&gt;
&amp;gt; &amp;gt;   &lt;br&gt;
&amp;gt; &amp;gt; Set MatLab = CreateObject(&quot;Matlab.Application&quot;)&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Call MatLab.Execute(&quot;clear all&quot;)&lt;br&gt;
&amp;gt; &amp;gt; Call MatLab.Execute(&quot;cd C:\My_Docs\Kurser_T\ProduktModellering_TMKT57\Excel_Matlab&quot;)&lt;br&gt;
&amp;gt; &amp;gt; Call MatLab.Execute(&quot;test1([ &quot; &amp; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C5&quot;).Value _&lt;br&gt;
&amp;gt; &amp;gt; &amp; &quot; &quot; &amp; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C6&quot;).Value _&lt;br&gt;
&amp;gt; &amp;gt; &amp; &quot; &quot; &amp; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C7&quot;).Value &amp; &quot;])&quot;)&lt;br&gt;
&amp;gt; &amp;gt; Call MatLab.Execute(&quot;ans&quot;)&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Call MatLab.GetFullMatrix(&quot;ans&quot;, &quot;base&quot;, MReal, MImag)&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;Stress&quot;).Value = MReal&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; End Sub&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Running the m-file called test1 which looks like this:&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; function Stress= test1(x);&lt;br&gt;
&amp;gt; &amp;gt; Radius = x(1);&lt;br&gt;
&amp;gt; &amp;gt; Thickness = x(2);&lt;br&gt;
&amp;gt; &amp;gt; Pressure = x(3);&lt;br&gt;
&amp;gt; &amp;gt; Stress = Pressure*Radius/Thickness;&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; This connection will work and run on a computer using the 2006b licens but not a computer using the 2007a what might be the problem? Have we forgotten to add references in excel in order to be able to run these types o files? Or have the possibility to run these types of codes been removed from the 2007 version?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Best regards &lt;br&gt;
&amp;gt; &amp;gt; /Filip and Oskar</description>
    </item>
    <item>
      <pubDate>Wed, 29 Oct 2008 20:04:02 -0400</pubDate>
      <title>Re: excel matlab connection and execution</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238320#607956</link>
      <author>Filip T?rnqvist</author>
      <description>Hey&lt;br&gt;
Thank you for the tip Ben. We'll have a look at thatprogram. Can we execute other m-files from excel with this interface? Since we have a GA-algorithm we'd like to run from excel we need this possibility.&lt;br&gt;
&lt;br&gt;
&quot;Ben Hinchliffe&quot; &amp;lt;ben.hinchliffe@bluereference.com&amp;gt; wrote in message &amp;lt;gea5bd$aeo$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi Filip and Oskar,&lt;br&gt;
&amp;gt; You may want to try using an add-in for Excel and Word called Inference for MATLAB.  Inference enables you to combine MATLAB commands, MATLAB software objects, data, and text within an Excel or Word document.  This document can then be executed to generate a results document (report). &lt;br&gt;
&amp;gt; By using Inference, you can avoid the hassle of visualbasic and working with the Office object model.&lt;br&gt;
&amp;gt; You can download a free 120-day trial of Inference for MATLAB at www.InferenceForMATLAB.com&lt;br&gt;
&amp;gt; Hope this helps!&lt;br&gt;
&amp;gt; -Ben&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Filip T?rnqvist&quot; &amp;lt;filto338@student.liu.se&amp;gt; wrote in message &amp;lt;ge9avl$8g2$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Do you mean the windows commandwindow or the matlab one?&lt;br&gt;
&amp;gt; &amp;gt; If we run the VB code we only get 65535 as the result. Eventhough we do send something else.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Best regards&lt;br&gt;
&amp;gt; &amp;gt; /Filip and Oskar&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &quot;Filip T?rnqvist&quot; &amp;lt;filto338@student.liu.se&amp;gt; wrote in message &amp;lt;ge7via$ogo$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Hello!&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; We're trying to connect and run matlab from excel using a subroutine(executed via a commandbutton in excel) with the following visualbasic code:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Sub Exc_to_Mat()&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Dim MatLab As Object&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Dim result As String&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Dim MReal() As Double&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Dim MImag() As Double&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;   &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Set MatLab = CreateObject(&quot;Matlab.Application&quot;)&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Call MatLab.Execute(&quot;clear all&quot;)&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Call MatLab.Execute(&quot;cd C:\My_Docs\Kurser_T\ProduktModellering_TMKT57\Excel_Matlab&quot;)&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Call MatLab.Execute(&quot;test1([ &quot; &amp; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C5&quot;).Value _&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp; &quot; &quot; &amp; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C6&quot;).Value _&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp; &quot; &quot; &amp; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C7&quot;).Value &amp; &quot;])&quot;)&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Call MatLab.Execute(&quot;ans&quot;)&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Call MatLab.GetFullMatrix(&quot;ans&quot;, &quot;base&quot;, MReal, MImag)&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;Stress&quot;).Value = MReal&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; End Sub&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Running the m-file called test1 which looks like this:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; function Stress= test1(x);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Radius = x(1);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Thickness = x(2);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Pressure = x(3);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Stress = Pressure*Radius/Thickness;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; This connection will work and run on a computer using the 2006b licens but not a computer using the 2007a what might be the problem? Have we forgotten to add references in excel in order to be able to run these types o files? Or have the possibility to run these types of codes been removed from the 2007 version?&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Best regards &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; /Filip and Oskar</description>
    </item>
    <item>
      <pubDate>Wed, 29 Oct 2008 20:08:01 -0400</pubDate>
      <title>Re: excel matlab connection and execution</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238320#607958</link>
      <author>Filip T?rnqvist</author>
      <description>I'm sorry to inform everyone that the problem still exist. We can run the matlab window from excel but it will only write 65535 in the specified excel position. Have we forgotten to activate some reference in vb or excel? Or have we missed smething else?&lt;br&gt;
&lt;br&gt;
Thank you for trying to help us Ashish. If you have any more ideas on what might be wrong please tell us.&lt;br&gt;
&lt;br&gt;
Best regards &lt;br&gt;
/Filip and Oskar&lt;br&gt;
&lt;br&gt;
&quot;Ashish Uthama&quot; &amp;lt;first.last@mathworks.com&amp;gt; wrote in message &amp;lt;op.ujsc4bxqa5ziv5@uthamaa.dhcp.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; apologies&lt;br&gt;
&amp;gt; I forgot the '!'&lt;br&gt;
&amp;gt; try this in the MATLAB command window:&lt;br&gt;
&amp;gt; matlabprompt&amp;gt;!matlab -regserver&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; You can also look at (explains how to do this from the windows command  &lt;br&gt;
&amp;gt; prompt):&lt;br&gt;
&amp;gt; &lt;a href=&quot;http://www.mathworks.com/support/solutions/data/1-S09OT.html?solution=1-S09OT&quot;&gt;http://www.mathworks.com/support/solutions/data/1-S09OT.html?solution=1-S09OT&lt;/a&gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; On Wed, 29 Oct 2008 03:32:01 -0400, Filip T?rnqvist  &lt;br&gt;
&amp;gt; &amp;lt;filto338@student.liu.se&amp;gt; wrote:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; We just tried this and matlab refuses to accept the command&lt;br&gt;
&amp;gt; &amp;gt; matlab -regserver in the main window. We only get a message saying  &lt;br&gt;
&amp;gt; &amp;gt; undefined function or variable.&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Best regards&lt;br&gt;
&amp;gt; &amp;gt; /Filip and Oskar&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &quot;Ashish Uthama&quot; &amp;lt;first.last@mathworks.com&amp;gt; wrote in message  &lt;br&gt;
&amp;gt; &amp;gt; &amp;lt;op.ujq880pha5ziv5@uthamaa.dhcp.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; Excel uses the registry to obtain the path/version of MATLAB to use for&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; this command:&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; Set MatLab = CreateObject(&quot;Matlab.Application&quot;)&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; Only one version of MATLAB may be registered using this per computer.&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; To ensure that MATLAB is registered and is indeed in the registry for&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; Excel to find, do this:&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; 1. Open the version of MATLAB you would like to use&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; 2. type this in thecommand window:&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;      matlab -regserver&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; 3. Type 'exit' in the new MATLAB command window that opens.&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; 4. Close the main MATLAB session&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; 5. Try your excel app..&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; On Tue, 28 Oct 2008 17:18:02 -0400, Filip T?rnqvist&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;lt;filto338@student.liu.se&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; Hello!&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; We're trying to connect and run matlab from excel using a&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; subroutine(executed via a commandbutton in excel) with the following&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; visualbasic code:&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; Sub Exc_to_Mat()&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; Dim MatLab As Object&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; Dim result As String&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; Dim MReal() As Double&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; Dim MImag() As Double&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; Set MatLab = CreateObject(&quot;Matlab.Application&quot;)&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; Call MatLab.Execute(&quot;clear all&quot;)&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; Call MatLab.Execute(&quot;cd&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; C:\My_Docs\Kurser_T\ProduktModellering_TMKT57\Excel_Matlab&quot;)&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; Call MatLab.Execute(&quot;test1([ &quot; &amp;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C5&quot;).Value _&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; &amp; &quot; &quot; &amp; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C6&quot;).Value _&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; &amp; &quot; &quot; &amp; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;C7&quot;).Value &amp; &quot;])&quot;)&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; Call MatLab.Execute(&quot;ans&quot;)&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; Call MatLab.GetFullMatrix(&quot;ans&quot;, &quot;base&quot;, MReal, MImag)&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; ThisWorkbook.Worksheets(&quot;sheet1&quot;).Range(&quot;Stress&quot;).Value = MReal&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; End Sub&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; Running the m-file called test1 which looks like this:&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; function Stress= test1(x);&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; Radius = x(1);&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; Thickness = x(2);&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; Pressure = x(3);&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; Stress = Pressure*Radius/Thickness;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; This connection will work and run on a computer using the 2006b licens&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; but not a computer using the 2007a what might be the problem? Have we&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; forgotten to add references in excel in order to be able to run these&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; types o files? Or have the possibility to run these types of codes  &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; been&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; removed from the 2007 version?&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; Best regards&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt; /Filip and Oskar&lt;br&gt;
&amp;gt; &amp;gt;</description>
    </item>
    <item>
      <pubDate>Wed, 29 Oct 2008 20:58:02 -0400</pubDate>
      <title>Re: excel matlab connection and execution</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238320#607965</link>
      <author>Walter Roberson</author>
      <description>Filip T?rnqvist wrote:&lt;br&gt;
&amp;gt; I'm sorry to inform everyone that the problem still exist. We can run the matlab window&lt;br&gt;
&amp;gt;  from excel but it will only write 65535 in the specified excel position.&lt;br&gt;
&lt;br&gt;
You haven't spoken about which excel versions you have on the respective machines.&lt;br&gt;
&lt;br&gt;
As I wrote in a posting a couple of days ago:&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://office.microsoft.com/en-us/excel/HA101375451033.aspx&quot;&gt;http://office.microsoft.com/en-us/excel/HA101375451033.aspx&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;A Microsoft Office Excel worksheet contains 65,536 rows and 256 columns.&lt;br&gt;
&amp;nbsp;You cannot increase the number of rows or columns beyond the maximum row and column limits.&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://support.microsoft.com/kb/264626&quot;&gt;http://support.microsoft.com/kb/264626&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;MORE INFORMATION&lt;br&gt;
&amp;nbsp;You cannot exceed the maximum limits of features in Excel. For example, you cannot&lt;br&gt;
&amp;nbsp;increase the number of worksheet rows beyond 65,536.&lt;br&gt;
&lt;a href=&quot;http://support.microsoft.com/kb/120596/en-us&quot;&gt;http://support.microsoft.com/kb/120596/en-us&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;In Microsoft Excel 97 for Windows, Microsoft Excel 2000, Microsoft Excel 2002,&lt;br&gt;
&amp;nbsp;and Microsoft Office Excel 2003, text files that contain more than 65,536 rows&lt;br&gt;
&amp;nbsp;cannot be opened in their entirety. You cannot open these files because these versions&lt;br&gt;
&amp;nbsp;of Microsoft Excel are limited to 65,536 rows.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;Notes&lt;br&gt;
&lt;br&gt;
&amp;nbsp;Versions of Excel earlier than Excel 97 have a limit of 16,384 rows.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;Versions of Excel later than Excel 2003 have a limit of 1,048,576 rows.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&quot;Versions of Excel later than Excel 2003&quot; includes only &quot;Excel 2007&quot; at the present&lt;br&gt;
time. And Matlab's xlswrite() has not caught up to Excel 2007 format in your version.</description>
    </item>
  </channel>
</rss>

