Problem with Excel Open method
조회 수: 1 (최근 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!