Gridlines in excel through interop

后端 未结 5 413
滥情空心
滥情空心 2021-01-18 06:54

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

相关标签:
5条回答
  • 2021-01-18 07:25
    using Excel = Microsoft.Office.Interop.Excel;
    Excel.Application oXL;
    oXL.Windows.get_Item(1).DisplayGridlines = false;
    
    0 讨论(0)
  • 2021-01-18 07:28

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

    ActiveWindow.DisplayGridlines = true
    
    0 讨论(0)
  • 2021-01-18 07:28

    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
    
    0 讨论(0)
  • 2021-01-18 07:29
    oXL.Windows.Application.ActiveWindow.DisplayGridlines = false;
    

    write the code just before save excel code line.

    0 讨论(0)
  • 2021-01-18 07:39

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

    0 讨论(0)
提交回复
热议问题