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