/// <summary> /// Ensure the worksheet only has rows with actual data. Remove cells with blanks, total rows, etc. /// </summary> /// <param name="ws"></param> private void CleanOutExtraDataOnWorksheet(Worksheet ws) { Common.WriteToDebugWindow(String.Format("CleanOutExtraDataOnWorksheet()")); switch (FileType) { case "FundServiceFees": case "FundAdvisoryFees": // TODO: May need different end columns. For now presume the 6 from fees spreadsheets. // Take the switch(FileType) code from GetOutputFileName(); Range dataRange = ws.Range[ws.Cells[1, 1], ws.Cells[RecordCount, 6]]; dataRange.Copy(); Globals.ThisAddIn.Application.ActiveWorkbook.Sheets.Add(); ((Worksheet)Globals.ThisAddIn.Application.ActiveSheet).Paste(); // Quietly delete the source worksheet to avoid confusion. ExcelHlp.DeleteSheet(ws); break; case "CashManagementFees": break; case "VITsFees": ProcessVITsFees(ws); break; default: MessageBox.Show("Processing of Manual FileType: {0} not currently supported", FileType); break; } }
/// <summary> /// Ensure the worksheet only has rows with actual data. Remove cells with blanks, total rows, etc. /// </summary> /// <param name="ws"></param> private void CleanOutExtraDataOnWorksheet(Worksheet ws) { Common.WriteToDebugWindow(String.Format("CleanOutExtraDataOnWorksheet()")); // TODO: May need different end columns. For now presume the 6 from fees spreadsheets. // Take the switch(FileType) code from GetOutputFileName(); Range dataRange = ws.Range[ws.Cells[1, 1], ws.Cells[RecordCount, 6]]; dataRange.Copy(); Globals.ThisAddIn.Application.ActiveWorkbook.Sheets.Add(); ((Worksheet)Globals.ThisAddIn.Application.ActiveSheet).Paste(); // Quietly delete the source worksheet to avoid confusion. ExcelHlp.DeleteSheet(ws); }