?
Solved

"Microsoft Office Excel is waiting for another application to complete an OLE action"

Posted on 2010-01-11
15
Medium Priority
?
1,324 Views
Last Modified: 2013-11-10
Hello All

I am developing an excel automation addin using c# .

When the calculations are on progress i get an prmpt
"Microsoft Office Excel is waiting for another application to complete an OLE action"

I have set
ClsComm.excel.DisplayAlerts = false;

but still it comes back

Please assist me

Senz
0
Comment
Question by:Senz79
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
15 Comments
 
LVL 9

Expert Comment

by:AnilKumarSharma
ID: 26290890
Check out in your code for waiting/infinite loop.
0
 
LVL 4

Author Comment

by:Senz79
ID: 26290907
I hope there is no such loop ... as the whole process takes only 5 mins to complete
0
 
LVL 36

Expert Comment

by:Miguel Oz
ID: 26291078
Check that you are not opening another instance of Excel. Only one instance must be working at any time
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 4

Author Comment

by:Senz79
ID: 26291148
yes there are two instances of excel, but as its a excel addin how to close the parent excel
0
 
LVL 36

Expert Comment

by:Miguel Oz
ID: 26298476
Your add-in should be using the same reference to the parent excel.Can you show me how you implement your OnConnect event.

For cleaning com interfaces properly. Please read:
http://stackoverflow.com/questions/166962/release-com-components
good explantion of "Marshal.ReleaseComObject"
http://edndoc.esri.com/arcobjects/9.2/NET/fe9f7423-2100-4c70-8bd6-f4f16d5ce8c0.htm

Basically you need to use Marshal.ReleaseComObject  for every worksheet,workbook and application object when your program finish and then call the garbage collector twice.

In your case after you finsih fixing your code I will restart my PC to avoid Excel instances that have not been released proerly floating around in your system.
0
 
LVL 4

Author Comment

by:Senz79
ID: 26299674
Hi
Kindly have a look
senz

Connect.cs
0
 
LVL 36

Expert Comment

by:Miguel Oz
ID: 26300955
Check:
http://support.microsoft.com/kb/316126
or if your Connect calss exist for the lifetime of your program, please do the following:
Not used:
 public Excel.Application ExcelApp;

You need to surface :
private Excel.Application applicationObject;

Plese add this public method:
public Excel.Application GetApplicationObject()
{
  return applicationObject;
}
0
 
LVL 36

Expert Comment

by:Miguel Oz
ID: 26302222
Sorry, I have a look at your botton implementation:
What does this code do?
Merge merge = new Merge();
                merge.StartMerge();
If this is your long operation:
How the applicationObject is setup?
I think your constructor need Excel.Application as parameter to assign on a field.
public Merge(Excel.Application app)
{
    applicationObject = app; // applicationObject is a private field of your class
}

Note: You do not need to create a new Excel.Application object, because it will open a second Excel instance. Please resuse the instance defined in Connect class

0
 
LVL 4

Author Comment

by:Senz79
ID: 26310700
yes that is my long process
I tried with your idea but i always get object reference not found
when i use the excell object in connect.
0
 
LVL 36

Accepted Solution

by:
Miguel Oz earned 2000 total points
ID: 26311961
Thus your code is not working correctly in the first place. applicationObject  must be available to your code
Can you put a breakpoint in the first line of:
Merge merge = new Merge(applicationObject);
merge.StartMerge();
 and tell me if applicationObject is null or not.

If it is null, you need to redo the project: create a new add-in project and add the custom button and merge back the connect code that adds the button. Sometimes happen that you have done some custom code and deleted some generated code vital for the system to work.
0
 
LVL 4

Author Comment

by:Senz79
ID: 26313092
okay i will follow ur instruction and get back asap
0
 
LVL 36

Expert Comment

by:Miguel Oz
ID: 26541168
I provided a solution, but unfortunately Senz79 did not provide any answer... as he needs to provide feedback from the debugger information that I requested.

It is shame that our time is being wasted with no consideration ....
0
 
LVL 4

Author Comment

by:Senz79
ID: 34110713
Kindly delete the data in the question on priority.Due to some security issue
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question