Info

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

Delete worksheet from Excel

1 回表示 (過去 30 日間)
Santosh Biradar
Santosh Biradar 2022 年 8 月 8 日
閉鎖済み: dpb 2022 年 8 月 8 日
この 質問 は dpb さんによってフラグが設定されました
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

回答 (0 件)

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by