How to hide gridlines in an excel sheet through C# WPF -


following

http://www.e-iceblue.com/tutorials/spire.xls/spire.xls-program-guide/worksheet/how-to-hide-or-show-gridlines-on-a-worksheet-in-c.html 

to hide gridlines should just:

workbook wb = app.workbooks.add(xlwbatemplate.xlwbatworksheet);   worksheet ws = wb.worksheets[1];    ws.gridlinesvisible = false;<----wrong 

but wrong.

and solution here

how disable gridlines in excel using open xml c#?

does not work. other method?

thank in advance. patrick

with no third party library, using simple excel interop (microsoft.office.interop.excel), should work this:

microsoft.office.interop.excel.application xlapp = new microsoft.office.interop.excel.application();  xlapp.visible = true;  workbook wb = xlapp.workbooks.add(xlwbatemplate.xlwbatworksheet); worksheet ws = wb.worksheets[1];  xlapp.activewindow.displaygridlines = false; 

Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -