Effacer les filtres
Effacer les filtres

xlswrite doesn't work when passing on Matlab 2013

2 vues (au cours des 30 derniers jours)
Tuan-Tu
Tuan-Tu le 23 Juin 2016
Commenté : Shameer Parmar le 23 Juin 2016
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

Réponses (1)

Shameer Parmar
Shameer Parmar le 23 Juin 2016
Try removing all ' [~,~]' from xlswrite() coammnd.. and run the code..
  2 commentaires
Tuan-Tu
Tuan-Tu le 23 Juin 2016
Modifié(e) : Stephen23 le 23 Juin 2016
I tried it but it doesn't work either.
Shameer Parmar
Shameer Parmar le 23 Juin 2016
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']

Connectez-vous pour commenter.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by