Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

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

1 Ansicht (letzte 30 Tage)
Santosh Biradar
Santosh Biradar am 4 Aug. 2022
Geschlossen: dpb am 4 Aug. 2022
Diese(r) Frage wurde durch dpb markiert
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

Antworten (0)

Diese Frage ist geschlossen.

Produkte


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by