Problem with Excel Open method
显示 更早的评论
Hi,
I am trying to use MATLAB to export some data. I implemented the following code snippet and plan to use the xlswrite1 function after (there is a lot of data to transfer):
function [] = write_out_dl21(fullfilename_in,dl21_param,data_in_display,data_in_summary_itvl,data_in_summary_total)
% Open file and call Excel methods
[pathstr, filename_in, file_ext] = fileparts(fullfilename_in)
% Excel methods DO not like spaces in the file names!
filename_in=strrep(filename_in,' ','_')
fullname_out = strcat(pathstr,'\',filename_in,'_OUT',file_ext);
The code above gives the error:
??? Invoke Error, Dispatch Exception:
Source: Microsoft Excel
Description: Excel cannot open the file 'inner_oslofjord_1_udp_ALL_EN_OUT.xlsx' because the file format or file
extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of
the file.
Help File: xlmain11.chm
Help Context ID: 0
Error in ==> write_out_dl21 at 38
ExcelWorkbook = Excel.workbooks.Open(fullname_out);
Do you have any hint? I tried shorter file names but it does not work...Using Windows 7 and MATLAB R2007b
Jose
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!