xlswrite doesn't work when passing on Matlab 2013
1 次查看(过去 30 天)
显示 更早的评论
Hello everyone, I used xlswrite to create excel file as normally. I've used Matlab v2011, and the code works well until I made a try on Matlab 2013 with the same lines of code. This time, with v2013, excel files wasn't created, there was no errors, so I'm very confused because xlswrite is supposed to work on 2013 as weel as 2011, isn't it ?
%%--------------Ecriture des matrices dans un .xls------------------------
% % Ouverture de l'application Excel
Excel = actxserver('Excel.Application') ;
% % Ouverture du fichier Excel source
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell,'MAT ALL','B4') ;
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell_R,'DECH kWhcell','B4') ;
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell_check,'Bilan 4 check','B4') ;
if S.Save_SIM_option == 2
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell_RC,'MAT RC','B4') ;
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell_P,'MAT P','B4') ;
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell_CR,'CR kWhcell','B4') ;
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell_CL,'CL kWhcell','B4') ;
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell_recup,'recup kWhcell','B4') ;
end
Do you know what could be the problem please ? Thanks a lot
0 个评论
回答(1 个)
Shameer Parmar
2016-6-23
Try removing all ' [~,~]' from xlswrite() coammnd.. and run the code..
2 个评论
Shameer Parmar
2016-6-23
ok.. in your provided path for excel file, dot (.) is there.. I guess that is the issue..
Try removing that dot (.) and check..
In this string.. in between 'cd' and backslash(\)..
[cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls']
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!