Azzera filtri
Azzera filtri

Hide excel sheet form resulted Excel file

4 visualizzazioni (ultimi 30 giorni)
Santosh Biradar
Santosh Biradar il 28 Lug 2022
Modificato: Santosh Biradar il 28 Lug 2022
Hello
I have created 3 sheets in same excel. I want to Hide Sheet number 2.
excelFile3 = strcat('SummaryResult','.xlsx');
excelName3 = fullfile(selPath,excelFile3);
Excel = actxserver('Excel.Application');
Workbooks = Excel.Workbooks;
Workbook = Workbooks.Open(excelName3);
Sheets = Excel.ActiveWorkBook.Sheets;
Sheet = get(Sheets,'Item',1);
Sheet.Activate;
......
Script to modify
....
Sheet = get(Sheets,'Item',2);
Sheet.Activate;
......
Script to modify sheet formating
....
Sheet = get(Sheets,'Item',3);
Sheet.Activate;
......
Script to modify sheet formating
....
Workbook.Save;
Excel.Quit;
Excel.delete;
Thank You

Risposte (1)

Ishan Gupta
Ishan Gupta il 28 Lug 2022
  1 Commento
Santosh Biradar
Santosh Biradar il 28 Lug 2022
Thank you for your responce.
I checked it.
But unable to understand where and which lines to be added in the script.
Excel = actxserver('Excel.Application');
WB = invoke(Excel.Workbooks,'open', theFileName);
WB.Worksheets.Item(1).Visible = 'xlSheetHidden';
WB.Worksheets.Item(1).Visible = 'xlSheetVisible';
Could you please make it possible?
Your help would be very helpful.
Thanks again.

Accedi per commentare.

Prodotti


Release

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by