 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Rei Guest
|
Posted: Mon Sep 25, 2006 3:31 pm Post subject: Ole Error Excel |
|
|
Hi,
I got an error OLE -2146959355: Server Execution Failed while trying to
export and view my report to Excel after several times.
Here's my code:
uses ComObj;
var Excel: Variant;
Workbook: Variant;
begin
try
Excel:= CreateOleObject('Excel.Application');
//Export to 'C:\export.xls';
Excel.Workbooks.open('C:\export.xls');
Workbook := Excel.ActiveWorkBook;
Excel.Visible:= True;
finally
WorkBook := Unassigned;
Excel := Unassigned;
end;
end;
This error only happens in Win98, and it got raised in line CreateOleObject;
It seems that Excel still hang around in memory, running invisibly, and
causing low of virtual memory in my computer.
What am I doing wrong?
TIA |
|
| Back to top |
|
 |
Mike Shkolnik Guest
|
Posted: Tue Sep 26, 2006 1:44 am Post subject: Re: Ole Error Excel |
|
|
Add the next lines in finally section:
Workbook.Close;
Excel.Quit;
--
With best regards, Mike Shkolnik
E-mail: mshkolnik (AT) scalabium (DOT) com
WEB: http://www.scalabium.com
"Rei" <niwra2000 (AT) yahoo (DOT) com> wrote in message
news:4517b00d (AT) newsgroups (DOT) borland.com...
| Quote: | Hi,
I got an error OLE -2146959355: Server Execution Failed while trying to
export and view my report to Excel after several times.
Here's my code:
uses ComObj;
var Excel: Variant;
Workbook: Variant;
begin
try
Excel:= CreateOleObject('Excel.Application');
//Export to 'C:\export.xls';
Excel.Workbooks.open('C:\export.xls');
Workbook := Excel.ActiveWorkBook;
Excel.Visible:= True;
finally
WorkBook := Unassigned;
Excel := Unassigned;
end;
end;
This error only happens in Win98, and it got raised in line
CreateOleObject;
It seems that Excel still hang around in memory, running invisibly, and
causing low of virtual memory in my computer.
What am I doing wrong?
TIA
|
|
|
| Back to top |
|
 |
Oliver Townshend Guest
|
Posted: Tue Sep 26, 2006 2:05 am Post subject: Re: Ole Error Excel |
|
|
| Quote: | Workbook.Close;
Excel.Quit;
|
But he's making the Workbook visible, so I think he's passing it to the user
to play with.
Oliver Townshend |
|
| Back to top |
|
 |
Rei Guest
|
Posted: Tue Sep 26, 2006 6:22 am Post subject: Re: Ole Error Excel |
|
|
Thx for the reply.
Yes, I left it open, so it's up to user when to close it.
But after consecutive export/open and manual close, this error still got
raised.
"Oliver Townshend" <oliveratzipdotcomdotau> wrote in message
news:451844a1 (AT) newsgroups (DOT) borland.com...
| Quote: | Workbook.Close;
Excel.Quit;
But he's making the Workbook visible, so I think he's passing it to the
user
to play with.
Oliver Townshend
|
|
|
| Back to top |
|
 |
Rei Guest
|
Posted: Mon Oct 02, 2006 6:14 am Post subject: Re: Ole Error Excel |
|
|
This error quickly got raised if I had my harddisk low in space and bigger
data to export.
Is there a way to clean up all the memory used to call OLE app?
"Rei" <niwra2000 (AT) yahoo (DOT) com> wrote in message
news:451880e2 (AT) newsgroups (DOT) borland.com...
| Quote: | Thx for the reply.
Yes, I left it open, so it's up to user when to close it.
But after consecutive export/open and manual close, this error still got
raised.
"Oliver Townshend" <oliveratzipdotcomdotau> wrote in message
news:451844a1 (AT) newsgroups (DOT) borland.com...
Workbook.Close;
Excel.Quit;
But he's making the Workbook visible, so I think he's passing it to the
user
to play with.
Oliver Townshend
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|