Info

この質問は閉じられています。 編集または回答するには再度開いてください。

how to copy sheet from one excel to another sheet of excel.

1 回表示 (過去 30 日間)
Santosh Biradar
Santosh Biradar 2022 年 8 月 4 日
閉鎖済み: dpb 2022 年 8 月 4 日
この 質問 は dpb さんによってフラグが設定されました
Hello
I tried below code
excelFile1 = fname; --> It is having Excel file format data with .xlsx extension
excelName1 = fullfile(newPath,excelFile1);
excel = actxserver('Excel.Application');
Workbooks = excel.Workbooks;
wbsource = Workbooks.Open(excelName);
wbdest = Workbooks.Open(excelName1);
ws = wbsource.Worksheets.Item(newidx); ---> here newidx will be having sheet name from OLD excel.
ws.Copy(wbdest.Worksheets.Item(1)); ----> error at this line
wbdest.Save %save destination workbook
excel.Quit
Error:
Dot indexing is not supported for variables of this type.
Error in IncDecAnalysis (line 58)
ws.Copy(wbdest.Worksheets.Item(1));
I have seen few of documents but could not find solution.
Thank you

回答 (0 件)

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by