private void button1_Click(object sender, EventArgs e) { workbook = new XLWorkbook(txtExcelPath.Text); worksheet = workbook.Worksheet(1); int lastRow = worksheet.LastRow().RowNumber(); RemoveSpace(2, 1000); Reset(2, 1000); RemoveSpace(3, 1000); Reset(3, 1000); Reset(4, 1000); worksheet.Columns().Width = 10; workbook.Save(); MessageBox.Show("結束"); }