<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238211</link>
    <title>MATLAB Central Newsreader - Using Compiled XLS File</title>
    <description>Feed for thread: Using Compiled XLS File</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>Mon, 27 Oct 2008 02:06:02 -0400</pubDate>
      <title>Using Compiled XLS File</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238211#607427</link>
      <author>Brian </author>
      <description>I have a MS Excel file that serves as a template for data reporting.&lt;br&gt;
&lt;br&gt;
In my m-file, I create a new Excel file by copying the template with the COPYFILE command.  The name of the new file varies by input.  Following analysis, fields of the new file are populated with results.  The process repeats several times.&lt;br&gt;
&lt;br&gt;
Everything works beautifully from the command window within MATLAB.&lt;br&gt;
&lt;br&gt;
When I compile my code to create a stand-alone application, I always include the template source file  along with the m-file and it compiles without error.  However, upon executing the stand-alone application, I receive an error at the COPYFILE command: it can not find the source file.&lt;br&gt;
&lt;br&gt;
Please let me know if you have any suggestions to resolving this issue.</description>
    </item>
    <item>
      <pubDate>Mon, 27 Oct 2008 13:07:19 -0400</pubDate>
      <title>Re: Using Compiled XLS File</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238211#607494</link>
      <author>Ashish Uthama</author>
      <description>How are you specifying the template file path to the COPYFILE function?&lt;br&gt;
&lt;br&gt;
I believe you should just addresss it by name since all included files in  &lt;br&gt;
the projec will be on the MATLAB path.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
On Sun, 26 Oct 2008 22:06:02 -0400, Brian  &amp;lt;ceo21mil@hotmail.com&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt; I have a MS Excel file that serves as a template for data reporting.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; In my m-file, I create a new Excel file by copying the template with the  &lt;br&gt;
&amp;gt; COPYFILE command.  The name of the new file varies by input.  Following  &lt;br&gt;
&amp;gt; analysis, fields of the new file are populated with results.  The  &lt;br&gt;
&amp;gt; process repeats several times.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Everything works beautifully from the command window within MATLAB.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; When I compile my code to create a stand-alone application, I always  &lt;br&gt;
&amp;gt; include the template source file  along with the m-file and it compiles  &lt;br&gt;
&amp;gt; without error.  However, upon executing the stand-alone application, I  &lt;br&gt;
&amp;gt; receive an error at the COPYFILE command: it can not find the source  &lt;br&gt;
&amp;gt; file.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Please let me know if you have any suggestions to resolving this issue.</description>
    </item>
    <item>
      <pubDate>Mon, 27 Oct 2008 14:25:49 -0400</pubDate>
      <title>Re: Using Compiled XLS File</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238211#607511</link>
      <author>Peter Webb</author>
      <description>If you can post the exact text of the error message, and the command that &lt;br&gt;
generated it, we can probably offer more precise diagnostics.&lt;br&gt;
&lt;br&gt;
&quot;Brian &quot; &amp;lt;ceo21mil@hotmail.com&amp;gt; wrote in message &lt;br&gt;
news:ge37ma$7rk$1@fred.mathworks.com...&lt;br&gt;
&amp;gt;I have a MS Excel file that serves as a template for data reporting.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; In my m-file, I create a new Excel file by copying the template with the &lt;br&gt;
&amp;gt; COPYFILE command.  The name of the new file varies by input.  Following &lt;br&gt;
&amp;gt; analysis, fields of the new file are populated with results.  The process &lt;br&gt;
&amp;gt; repeats several times.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Everything works beautifully from the command window within MATLAB.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; When I compile my code to create a stand-alone application, I always &lt;br&gt;
&amp;gt; include the template source file  along with the m-file and it compiles &lt;br&gt;
&amp;gt; without error.  However, upon executing the stand-alone application, I &lt;br&gt;
&amp;gt; receive an error at the COPYFILE command: it can not find the source file.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Please let me know if you have any suggestions to resolving this issue. </description>
    </item>
    <item>
      <pubDate>Mon, 27 Oct 2008 16:30:03 -0400</pubDate>
      <title>Re: Using Compiled XLS File</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238211#607550</link>
      <author>Brian </author>
      <description>Thank you for the responses.&lt;br&gt;
&lt;br&gt;
Below is the relevant portion of my code:&lt;br&gt;
&lt;br&gt;
% Excel Summary File&lt;br&gt;
directoryName = ['Lot ', lotSummary.LotID, '&amp;#092;'];&lt;br&gt;
mkdir(directoryName);&lt;br&gt;
fileName = ['Lot ', lotSummary.LotID, ' Summary.xls'];&lt;br&gt;
copyfile('WTASummary.xls', [directoryName, fileName]);&lt;br&gt;
cd(directoryName);&lt;br&gt;
&lt;br&gt;
And the error message from the compiled stand alone application:&lt;br&gt;
&lt;br&gt;
??? Error using ==&amp;gt; copyfile&lt;br&gt;
No matching files were found.&lt;br&gt;
&lt;br&gt;
MATLAB:COPYFILE:FileDoesNotExist&lt;br&gt;
&lt;br&gt;
Best regards,&lt;br&gt;
Brian</description>
    </item>
    <item>
      <pubDate>Mon, 27 Oct 2008 18:27:48 -0400</pubDate>
      <title>Re: Using Compiled XLS File</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238211#607573</link>
      <author>Ashish Uthama</author>
      <description>How do you include WTASummary.xls? The recommended approach is to place it  &lt;br&gt;
under 'Other files' in DEPLOYTOOL.&lt;br&gt;
&lt;br&gt;
File under this section will be extracted to the CTF root directory, under  &lt;br&gt;
a subdirectory which has the same name as the project.&lt;br&gt;
You should then use the CTFROOT function to build up the path to this  &lt;br&gt;
excel file. Something along the lines of:&lt;br&gt;
&lt;br&gt;
copyfile(fullfile(ctfroot,'yourProjectName','WTASummary.xls'),  &lt;br&gt;
[directoryName, fileName]);&lt;br&gt;
&lt;br&gt;
Also:&lt;br&gt;
&amp;gt; directoryName = ['Lot ', lotSummary.LotID, '&amp;#092;'];&lt;br&gt;
&amp;gt; mkdir(directoryName);&lt;br&gt;
Note: this creates the dir in the 'current working directory'. This might  &lt;br&gt;
not be what you expect on a deployed application, ensure you CD to a  &lt;br&gt;
specific directory first or use absolute path names.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
On Mon, 27 Oct 2008 12:30:03 -0400, Brian  &amp;lt;ceo21mil@hotmail.com&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt; Thank you for the responses.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Below is the relevant portion of my code:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; % Excel Summary File&lt;br&gt;
&amp;gt; directoryName = ['Lot ', lotSummary.LotID, '&amp;#092;'];&lt;br&gt;
&amp;gt; mkdir(directoryName);&lt;br&gt;
&amp;gt; fileName = ['Lot ', lotSummary.LotID, ' Summary.xls'];&lt;br&gt;
&amp;gt; copyfile('WTASummary.xls', [directoryName, fileName]);&lt;br&gt;
&amp;gt; cd(directoryName);&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; And the error message from the compiled stand alone application:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; ??? Error using ==&amp;gt; copyfile&lt;br&gt;
&amp;gt; No matching files were found.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; MATLAB:COPYFILE:FileDoesNotExist&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Best regards,&lt;br&gt;
&amp;gt; Brian</description>
    </item>
    <item>
      <pubDate>Mon, 27 Oct 2008 19:32:01 -0400</pubDate>
      <title>Re: Using Compiled XLS File</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238211#607586</link>
      <author>Brian </author>
      <description>Thank you Ashish.&lt;br&gt;
&lt;br&gt;
Your suggestion to use&lt;br&gt;
&amp;gt; copyfile(fullfile(ctfroot,'yourProjectName','WTASummary.xls'),  &lt;br&gt;
&amp;gt; [directoryName, fileName]);&lt;br&gt;
solved the problem.&lt;br&gt;
&lt;br&gt;
In my program I also access another &quot;Other file&quot; - specifically a perl script - but without using ctfroot.  It is interesting that it is necessary in one case but not the other.&lt;br&gt;
&lt;br&gt;
Again, thank you for your help.&lt;br&gt;
&lt;br&gt;
Best regards,&lt;br&gt;
Brian</description>
    </item>
  </channel>
</rss>

