using xlswrite to edit excel, how to remove the 'content-selection' when I open it.

When I use xlswrite to edti an excel. then I open it, it will shows the edited part as bellow 'now: selection status'(with a gray box).But I want it to be as 'expected: no-selection status'

2 Comments

Can you tell the use case for above request.
I want 'write content to Excel, but not indicate the part I write'. Currently, the gray-selection shows it.

Sign in to comment.

 Accepted Answer

It is not recommed to use xlswrite(). Instead try to use writetable, writecell, writematrix.
The option of not selecting is not present with xlswrite().
But you can try to use UseExcel=false with above writefunctions

3 Comments

I would love to but until they fix them, I won't.
The problem with those functions is that they remove all formatting on the workbook. For example if you have an existing workbook and it has certain cells in bold, with borders, with colored shading, etc., those functions blow away all those formatting things you've spent so much trouble on getting everything to look just right, and all you're left with is a plain boring black and white workbook with none of the formatting remaining. Yes, I have let tech support know, and they've reproduced it, and it's on the feature enhancement suggestion list. Hopefully it gets done soon.
Thanks, M.N
  1. I am using R2013b, only 'writetable' is available, but not 'writecell' nor 'writematrx', But 'UseExcel' is not available either in R2013b.
  2. In R2019b, 'writetable' could sovle my issue, even not using 'UseExcel'.
I am now using the way in 2013b of, thanks to @Image Analyst. while it will slow down a bit of my program.
Yes, with old versions of MATLAB, they did not leave the Excel running as an ActiveX server so each time you called it, it has to launch Excel all over again. The way around that is to use ActiveX the whole way though. I'm attaching an example.

Sign in to comment.

More Answers (1)

You can call xlswrite() again to just write 'Req#' to A1
xlswrite(fileName, 'Req #', sheetName, 'A1');

Products

Release

R2013b

Community Treasure Hunt

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

Start Hunting!