Gridlines in excel through interop

允我心安 提交于 2019-12-01 16:54:57

问题


Any idea where the setting is hiding for turning gridlines off while using excel 2003 from interop?


回答1:


DisplayGridlines is a method on an Excel Window object. For example:

ActiveWindow.DisplayGridlines = true



回答2:


using Excel = Microsoft.Office.Interop.Excel;
Excel.Application oXL;
oXL.Windows.get_Item(1).DisplayGridlines = false;



回答3:


oXL.Windows.Application.ActiveWindow.DisplayGridlines = false;

write the code just before save excel code line.




回答4:


Currently, using VS2012 and I did it as follows:

Excel.Application oXl = new Excel.Application();

oXl.Visible = false; // true for debug

Excel.Workbook wb = oXl.Workbooks.Add();
Excel.Worksheet ws = wb.Worksheets[1];

oXL.ActiveWindow.DisplayGridlines = false; //true is the default in Excel



回答5:


ActiveWorkbook.Windows(1).DisplayGridlines = True 'OR False



来源:https://stackoverflow.com/questions/497220/gridlines-in-excel-through-interop

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!