|
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..............
|