Gridlines in excel via interop

Any idea where the setting is hiding to disable grid lines when using excel 2003 from interop?

+6
excel interop
source share
5 answers

DisplayGridlines is an Excel object method. For example:

ActiveWindow.DisplayGridlines = true 
+11
source share
 using Excel = Microsoft.Office.Interop.Excel; Excel.Application oXL; oXL.Windows.get_Item(1).DisplayGridlines = false; 
+4
source share
 oXL.Windows.Application.ActiveWindow.DisplayGridlines = false; 

write code before saving the excel code line.

+3
source share

Currently using VS2012 , and I have done 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 
+2
source share

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

0
source share

All Articles