How to disable gridlines in excel sheet using matlab script

8 visualizaciones (últimos 30 días)
kamalakar
kamalakar el 3 de Jul. de 2017
Comentada: Tyler Merritt el 20 de Mayo de 2019
Need to disable gridlines which appear in the excel report generated

Respuestas (1)

ES
ES el 3 de Jul. de 2017
You have to use ActiveX
% Create COM object for the current Sheet.
objExcel=actxserver('excel.application');
objExcelW=objExcel.Workbooks;
objExcelF=objExcelW.Open(sExcelFileName));
objExcelS=objExcelF.ActiveSheet;
objExcelS.DisplayGridlines = False
% Delete the COM Object.
objExcelF.Save;
objExcelF.Close;
objExcel.Quit;
objExcel.delete;
  4 comentarios
SS585
SS585 el 6 de Sept. de 2018
This does not work, is there any other solution?
Tyler Merritt
Tyler Merritt el 20 de Mayo de 2019
I was getting the same error, finally found a solution that worked for me.
% Open Excel and make it visible
AppObj = actxserver('Excel.Application');
AppObj.Visible = true;
% Select workbooks
WkbkObj = AppObj.Workbooks;
% Turn off gridlines in active workbook
WkbkObj.Application.ActiveWindow.DisplayGridlines = false;

Iniciar sesión para comentar.

Categorías

Más información sobre Use COM Objects in MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by