How to Cope XLS Worksheet using Matlab

2 ビュー (過去 30 日間)
Bill Rooker
Bill Rooker 2013 年 3 月 19 日
回答済み: Pruthvi G 2019 年 9 月 30 日
Hello everyone,
Is there any way to copy an XLS worksheet, rename it, and post data to it? I have a template worksheet that is formatted in the manner I want it. I have different data sets in which I want to use the template so that I can minimize having to reformat every worksheet I generate. Note that I did not see anything under XLSWRITE, but let me know otherwise.
Thank you for any assistance.
Best regards,
Bill Rooker

回答 (3 件)

Conrad
Conrad 2013 年 3 月 19 日
Hi Bill, you can use dos commands from within MATLAB to copy the file:
original_file = 'orginal_file_name';
copied_file = 'copied_field_name';
dos(['copy ' original_file ' ' copied_file]);
You can now use xlswrite to write to the copied sheet.
Conrad
  1 件のコメント
Bill Rooker
Bill Rooker 2013 年 3 月 21 日
Hello Conrad,
Thanks for the response. To clarify, I am looking for a way to copy a template worksheet from within a XLS file so that I only have 1 file with multiple worksheets. Do you have a solution for this? Thanks.
Best regards,
Bill Rooker

サインインしてコメントする。


Cedric
Cedric 2013 年 3 月 19 日
編集済み: Cedric 2013 年 3 月 19 日
You can actually write data into an existing, preformated worksheet using xlswrite, because it doesn't change the format. If you had a template file, you could copy this file first and then write data into the copy. Now if you really want to add/copy worksheets to/within an existing file/workbook, I think that you will need to have a look at ACTXSERVER. I've never used it myself, though.

Pruthvi G
Pruthvi G 2019 年 9 月 30 日

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by