Hi, add a
end;
after the
finally, see the vertical lines, in the code window. You can see that the
end;
after the finally belongs to the
begin
of the procedure.
So, as said Blaazen, the correct syntax is Try... finally ... end;
So your procedure should be like this:
procedure MiProcedure();
Var
//put your variable here
Begin
Try
//Put code here;
Finally
//Even you don't put any code here, you must put the end
end; //Always you must put the end;
end; //This end; belongs to the "begin"
In other way, if you don't put any code after the finally, why do you use it?
/BlueIcaro
Edit: I can't write you code in my lazarus,
XLApp := CreateOleObject('Excel.Application');
is a IDispatch, and It doesn't have the property workbooks. So I think it will be better if you attach you code at the post.