How to disable gridlines in excel sheet using matlab script

Antworten (1)

ES
ES am 3 Jul. 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 Kommentare

Hi Smith thank you for the reply but ths did not work for me. The below is the error occurred
No public property DisplayGridlines exists for class Interface.000208D8_0000_0000_C000_000000000046.
Yeah same here.
This does not work, is there any other solution?
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;

Melden Sie sich an, um zu kommentieren.

Kategorien

Gefragt:

am 3 Jul. 2017

Kommentiert:

am 20 Mai 2019

Community Treasure Hunt

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

Start Hunting!

Translated by