I have the following code:
private void btnExcel_Click(object sender, EventArgs e) { if (dataGridView1.Rows.Count > 0) {