Delete worksheet from Excel

dpb ha marcado con alerta este/a pregunta
  • Marcado con alerta como Duplicada por dpb hace el 8 de Ag. de 2022.
Hello
I have tried below
In the main code,
%%Value of newidx = "AAA" i,e, Excel Sheet Name
%% Value of excelName1 = D:\SANTOSH\Task2\Aug\NewSfun_SummaryResult\ABC.xlsx
After calling DeleteExcelSheets(excelName1, newidx) in the script.
I am expecting the sheet has to be deleted from theat excelName1.
function DeleteExcelSheets(excelName1, newidx)
try
Excel = actxserver('Excel.Application');
Workbooks = Excel.Workbooks;
Workbook = Workbooks.Open(excelName1);
Sheets = Excel.ActiveWorkBook.Sheets;
Sheets.Item(newidx).Delete;
end
Thank you

Respuestas (0)

La pregunta está cerrada.

Productos

Versión

R2019b

Preguntada:

el 8 de Ag. de 2022

Cerrada:

dpb
el 8 de Ag. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by