Problem with Excel Open method
3 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Image Analyst
2015 年 4 月 8 日
Jose, your write_out_dl21() function does not do anything at all with Excel, xlswrite1(), or ActiveX. So we can't debug it.
Does "inner_oslofjord_1_udp_ALL_EN_OUT.xlsx" exist already, or not? If it exists, please attach it.
See my Excel ActiveX demo - maybe that will help you.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!