color a cell excel using matlab
89 次查看(过去 30 天)
显示 更早的评论
Hello, i have a matrix that i'm stocking it into an excel file and i'm trying to color a cell of my excel file, which function should i use please, i don't think that xlswrite allow me to do that ? thank you!!
4 个评论
采纳的回答
Dennis
2018-7-17
编辑:Dennis
2018-7-17
Actually your code looks good despite a small typo.
Excel = actxserver('excel.application');
% ^ capital E
Copy & paste exampel:
a={'This', 'is','a','test'};
[filename, pathname] = uiputfile('*.xls', 'Choose a file name');
outname = fullfile(pathname, filename);
xlswrite(outname,a);
excel=actxserver('Excel.application');
wb=excel.Workbooks.Open(outname);
wb.Worksheets.Item(1).Range('A1').Interior.Color=hex2dec('00FF00');
wb.Save
wb.Close
winopen(outname)
4 个评论
Dennis
2018-7-17
char() converts a number to an ASCII sign. 'A' has index 65 on ASCII table - that's pretty much all i know about it =P
I think the first 128 (0-127) chars are set in stone. All others can vary depending on your local setting.
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!