Strip Formulas, Just Leave Values
Posted: Thu Oct 08, 2009 3:13 pm
I need to essentially copy the first sheet of a multi-sheet workbook to a new sheet and just take along the values, not formulas. Then delete all of the previous sheets.
So the workbook has sheets A, B and C. A shows summary calculations based on B and C. I want to add sheet D, copy the values from A to it and then delete sheets A, B and C.
My end result is that I want to have an XLS file that only has the Summary sheet.
I tried this but the formulas seem to be coming along:
XLS.Sheets.Add;
XLS.CopyCells(0, 0, 0, 100, 100, XLS.Sheets.Count - 1, 0, 0, [ccoCopyValues]);
while XLS.Sheets.count > 1 do
XLS.Sheets.Delete(0);
XLS.WriteToStream(aSummaryReportData);
So the workbook has sheets A, B and C. A shows summary calculations based on B and C. I want to add sheet D, copy the values from A to it and then delete sheets A, B and C.
My end result is that I want to have an XLS file that only has the Summary sheet.
I tried this but the formulas seem to be coming along:
XLS.Sheets.Add;
XLS.CopyCells(0, 0, 0, 100, 100, XLS.Sheets.Count - 1, 0, 0, [ccoCopyValues]);
while XLS.Sheets.count > 1 do
XLS.Sheets.Delete(0);
XLS.WriteToStream(aSummaryReportData);