How to disable gridlines in excel sheet using matlab script

8 ビュー (過去 30 日間)
kamalakar
kamalakar 2017 年 7 月 3 日
コメント済み: Tyler Merritt 2019 年 5 月 20 日
Need to disable gridlines which appear in the excel report generated

回答 (1 件)

ES
ES 2017 年 7 月 3 日
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 件のコメント
SS585
SS585 2018 年 9 月 6 日
This does not work, is there any other solution?
Tyler Merritt
Tyler Merritt 2019 年 5 月 20 日
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;

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeUse COM Objects in MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by