DEV Community

Discussion on: Export DataGridView to Excel C# (Code Example Tutorial)

Collapse
 
farshadvl profile image
farshadvl

hi. that very useful code and I appreciate it.
I have just 1 question : how can I find cell range:
wb.Worksheet(1).Cell("{0}1:{1}1").Style.Fill.BackgroundColor = XLColor.DarkGreen;
you have set a1:c1 but datatcolumns change in each table