Thread Subject: Write2Excel error message

Subject: Write2Excel error message

From: Pete sherer

Date: 24 Sep, 2009 20:37:06

Message: 1 of 2

Somehow I got the error message:

Write2Excel( fileName, 0, 'sheetname', sheet, ...
                'A1', {hurrName}, ...
                'A15', tbl_1, ...
                'A30', tbl_2, ...
                'A46', tbl_3, ...
                'A62', tbl_4, ...
                'A78', tbl_5, ...
                'A95', tbl_6, ...
                'A111',tbl_7, ...
                'D9', tbl_8 );

??? Error using ==> Write2Excel at 157
Sorry...unable to open file ./output/loss_summary.xlsx

File does exist, so I don't know what the error was for.

exist( './output/loss_summary.xlsx')
ans =
     2

I would appreciate if someone can help me with this issue. Currently I am using XLSWRITE, but it doesn't allow multiple cell writing. Thanks,

xlswrite(fileName, {hurrName}, sheet, 'A1')
xlswrite(fileName, tbl_1, sheet, 'A15');
xlswrite(fileName, tbl_2, sheet, 'A30');
xlswrite(fileName, tbl_3, sheet, 'A46');
xlswrite(fileName, tbl_4, sheet, 'A62');
xlswrite(fileName, tbl_5, sheet, 'A78');
xlswrite(fileName, tbl_6, sheet, 'A95');
xlswrite(fileName, tbl_7, sheet, 'A111');
xlswrite(fileName, tbl_8, sheet, 'D9');

Subject: Write2Excel error message

From: ImageAnalyst

Date: 24 Sep, 2009 22:55:31

Message: 2 of 2

On Sep 24, 4:37 pm, "Pete sherer" <t...@abg.com> wrote:
> Somehow I got the error message:
>
> Write2Excel( fileName, 0, 'sheetname', sheet, ...
>                 'A1',  {hurrName}, ...
>                 'A15', tbl_1, ...
>                 'A30', tbl_2, ...
>                 'A46', tbl_3, ...
>                 'A62', tbl_4, ...
>                 'A78', tbl_5, ...
>                 'A95', tbl_6, ...
>                 'A111',tbl_7, ...
>                 'D9',  tbl_8 );
>
> ??? Error using ==> Write2Excel at 157
> Sorry...unable to open file ./output/loss_summary.xlsx
>
> File does exist, so I don't know what the error was for.
>
> exist( './output/loss_summary.xlsx')
> ans =
>      2
>
> I would appreciate if someone can help me with this issue. Currently I am using XLSWRITE, but it doesn't allow multiple cell writing.  Thanks,
>
> xlswrite(fileName, {hurrName}, sheet, 'A1')
> xlswrite(fileName, tbl_1, sheet, 'A15');
> xlswrite(fileName, tbl_2, sheet, 'A30');
> xlswrite(fileName, tbl_3, sheet, 'A46');
> xlswrite(fileName, tbl_4, sheet, 'A62');
> xlswrite(fileName, tbl_5, sheet, 'A78');
> xlswrite(fileName, tbl_6, sheet, 'A95');
> xlswrite(fileName, tbl_7, sheet, 'A111');
> xlswrite(fileName, tbl_8, sheet, 'D9');

---------------------------------------------------------
I don't know - I use xlswrite1 from the File Exhange, which WILL allow
multiple pokes without relaunching Excel each time.
It looks like there's something wrong with the filename perhaps. Can
you do just a simple file write with that same filename using fopen()
or csvwrite()? Maybe it doesn't like the dot. Maybe you can try to
fix up the name using fullfile() and fileparts(). You say the file
exists. Is it already open in Excel? Are you sure? Better check by
looking at the process list in case it's hidden or acting as a server
(in Windows, type control-shift-esc). If Excel has it open, you can't
open it again and will get an error. Do you get the error the very
first time you try the code after you launch MATLAB? Did you abort a
write in the middle of it by typing control-C perhaps and leaving
Excel alive and hidden as a server in the background with a lock on
that file?
Just some things to think about..............

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com