Gracias Lepe,
Realmente este es el codigo que tengo.
Por querer maquillarlo puse ese Delete() por error.
Código Delphi
[-]
procedure TFControlReportesExcel.LimpiarListaElementos;
var
i: integer;
begin
Self.PonerMsgEspera('Eliminando elementos...');
try
try
for i := 0 to slElementos.Count - 1 do
if Assigned( slElementos.Objects[i] ) then
if slElementos.Objects[i] is TObjElemento then
begin
if slElementos.Objects[i] is TObjTitulo then
begin
TObjTitulo(slElementos.Objects[i]).Free;
end
else if slElementos.Objects[i] is TObjFormulaExcel then
begin
TObjFormulaExcel(slElementos.Objects[i]).Free;
end
else if slElementos.Objects[i] is TObjConcepto then
begin
TObjConcepto(slElementos.Objects[i]).Free;
end;
end;
except
end;
finally
slElementos.Clear;
Self.QuitarMsgEspera();
end;
panGuias.Width:= ScrollBox1.Width + SIZEX;
panGuias.Height:= ScrollBox1.Height + SIZEY;
panDesign.Width:= ScrollBox1.Width;
panDesign.Height:= ScrollBox1.Height;
end;
La primera vez si tenia un Delete() (hace como un mes), pero ese fue corregido en la misma hora.... lo dejé comentarizado