Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2010-01-11
15
Medium Priority
?
1,395 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
  • 6
  • 6
13 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Starting up a Project
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…

580 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