Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Ole 1

Status
Not open for further replies.

ayse

Programmer
Jun 26, 2003
4
0
0
DE
I have programmes an Ole from Oracle forms to Excel. I ws happy, becauese everything was ok. But I have one Problem. When I releease the objects at the End of my programm.
ole2.release_obj(range);
ole2.release_obj(row);
ole2.release_obj(column);
ole2.release_obj(cell);
OLE2.RELEASE_OBJ(worksheet);
OLE2.RELEASE_OBJ(worksheets);
OLE2.RELEASE_OBJ(workbook);
OLE2.RELEASE_OBJ(workbooks);
OLE2.RELEASE_OBJ(application);

release the application is making a problem, so that the Excel is visible in the task, when the user close Excel and my forms application dont run. wenn I release application, Dr watson comes, when the user close the Excel. When I close may forms, bevor closing excel i have no trouble, but my forms does not run, when I close Excel bevor my mask. Who can me help?
 
The easiest way to troubleshoot this type of problem is to comment out certain sections of the code until Task Manager no longer shows an Excel process running.

For example, comment out all the code between the opening of the application object and the closing of the application object. If that part of the code works, then comment out all the code between the opening and closing of the workbooks object. Continue on in this fashion until your Excel process no longer closes when viewed in the Task Manager. When this happens, you'll know where your code is failing. Then it's just a matter of getting that section to work properly.

Usually this problem occurs when the objects aren't closed in the reverse order that they were opened. However, almost any error along the way can leave the Excel process running in the Task Manager.

When writing code for Excel or Word, I throw in a reference to each section of code. If an exception is raised, then that reference is displayed back to me, and I know exactly where the problem is. (I leave these references in the production code, so that if there is a problem reported by an end-user, the reference number points to the area that the problem occurred in.

Usually, the error is on the users end. (No mapped drive, wrong folder, logged in improperly, etc), but the reference minimizes the time I need to spend trying to resolve the the problem.

Here's an example:
DECLARE
dbg number;
...
BEGIN
dbg := 1;
--some code
dbg := 2;
--more code
dbg := 3;
--more code
dbg := 4;
EXCEPTION
WHEN others THEN
message( 'Error: debug point = '|| dbg);
END;


Note: If there are any stray Excel processes running when you start the program, there is a chance your program will fail even though nothing is wrong. So, before testing, make sure there are no extraneous Excel processes running.

 
I have a reference to each section, but there is no exception throwed.

Can you tell me, how I can test, if an extraneaus Excel process is running and how can I stop or use this for me.

thanks and regards

Ayse
 
Hi,
Try commenting
--OLE2.RELEASE_OBJ(application);
I goit the same problem and it worked for me.
Regds,
PVKiran
 
hi,
Try commenting the following line.
--OLE2.RELEASE_OBJ(application);
I got the same problem and this worked for me.
Regds
PVKiran
 
Ayse,

Can you tell me, how I can test, if an extraneous Excel process is running and how can I stop or use this for me

When I'm testing Oracle code for OLE2 applications (Excel of example), I usually get errors (as I can't find much documention on how to do it). When I get an error, often even after closing Excel, there is still an Excel.exe process left running in TaskManger. If I don't kill that rogue process, then I seem to continue getting problems, even after the code is fixed.

So this is what I do to test Excel or Word code:
1) Close all open Excel and Word documents.
2) Run your program.
3) If you get an error or unexpected results, then:
3a) If Excel or Word is open, close it.
3b) Open the TaskManager, go to the Processes tab, and look
for EXCEL.EXE or WINWORD.EXE processes. If you find any, highlight
the process, and click on the "End Process Task"
4) If it seems that everything is working, then:
4a) Close Excel or Word, if your code purposely left it open.
4b) Open the TaskManager, go to the Processes tab, and look
for EXCEL.EXE or WINWORD.EXE processes. If you find any, then
your code isn't working properly. So, highlight
the process, and click on the "End Process Task", then
try to figure out what's wrong.
4c) If you didn't find any EXCEL.EXE or WINWORD.EXE processes and
your application did what you wanted, then your program is working. Yeah!!!

I'm not sure why pvkiran is commenting out the release of the object, but you need to release all the objects, and you need to release them in the reverse order in which you opened them.

When testing the code, right after the release of all the objects, I have an alert pop up telling me that the code is finished. If there is a major problem, I usually don't see that message, in which case, I start adding a bunch of alerts throughout the code and start looking at the code right after the last alert message I received.

If you can't get your code to work, can you post it here, so we can take a look at it?

Steve
 
Ayse,

sfvb is right and he gave a vivid and useful itenary of the path to follow while dealing with the problem .
It The step ive mentioned worked for me but cant say why.
PVKiran
 
Hello Steve and PVKiran,

thanks for your answer. I was 4 weeks in Holdiday.I have tried many things. Also I have commented
--OLE2.RELEASE_OBJ(application);

That's right, that Dr. Watson not comes, but in the task manager, you can see excel.exe process. And we had an other Problem. You couldn't release the form mask and open an other mask, because our Oracle application didn'run any more. I have tried to release all objects in the reverse order. Before I went to holiday I had a solution, where excel and our oracle application did run. But if you open the task manager, you can see many excel.exe processes. I don't know, how I can solve this problem. The difference to my code before is that I have not a package, but a library. The user have now sometimes the problem, that they can't shut down, when too many processes are opened. But they know, that they can solve this problem with task manager. I must try a better solution, when I have more time.

I normally programming in Dbase, there I can check, if the office application is running or not, when yes I don't start the application, I use this running Instance. But in Oracle i dont't know, how I could do this.

I am sorry and hope you can anderstand my bad English.

Thanks

Aysw
 
Hello Steve and PVKiran,

thanks for your answer. I was 4 weeks in Holdiday.I have tried many things. Also I have commented
--OLE2.RELEASE_OBJ(application);

That's right, that Dr. Watson not comes, but in the task manager, you can see excel.exe process. And we had an other Problem. You couldn't release the form mask and open an other mask, because our Oracle application didn'run any more. I have tried to release all objects in the reverse order. Before I went to holiday I had a solution, where excel and our oracle application did run. But if you open the task manager, you can see many excel.exe processes. I don't know, how I can solve this problem. The difference to my code before is that I have not a package, but a library. The user have now sometimes the problem, that they can't shut down, when too many processes are opened. But they know, that they can solve this problem with task manager. I must try a better solution, when I have more time.

I normally programming in Dbase, there I can check, if the office application is running or not, when yes I don't start the application, I use this running Instance. But in Oracle i dont't know, how I could do this.

I am sorry and hope you can understand my bad English.

Thanks

Aysw
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top