Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Friday, December 7, 2012 8:57 AM
Hi,
I am not an avid programmer and have been stuck with this error for a long time.I would really like to understand the root cause of this error and the method to resolve it. Here is my problem :
I have some VBA code distributed between Excel Workbook and a Power Point Template. I trigger my code from Excel, which in turn opens up the Power Point Template and calls some macros written inside it. The arguments that I pass to Power Point macros also include user defined objects(whose classes have been defined in the Excel VBA code), besides other datatypes. The Power Point macros perform the function of populating the charts and tables in the Power Point Template with data, that it has received as arguments from Excel.
The above explained process works fine and is carried out for multiple iterations. Problem starts occurring after certain number of iterations and the error which occurs is : "Automation Error System Call Failed ; Error No. 80010100 (-2147417856) ".
I tried finding out a workaround over this problem, by (a) Closing the Power Point Application after every iteration and reopening it. This I did through VBA Code in Excel. (b) I wrote a VB Script which calls the main Excel VBA macro that was triggering the process. It keeps a track of number of iterations completed and whenever the error occurs it closes the Excel Application and reopens it and then calls the Excel Macro ensuring that the process is resumed from the point(i.e iteration no.) where it failed .
Unfortunately, my VB Script also fails after performing its function a certain number of times and the error that it throws is again: "System Call Failed ; Error No. 80010100".
I suspect that the problem might be system dependent, because my code gives different performance on different systems, but dosen't fair successfully on any of them.Please HELP !!!
Tuesday, December 11, 2012 3:39 PM ✅Answered | 1 vote
Anytime you have to resort to brute force to close an Office application there's something wrong. It usually pays to track down the source of the problem - before you're spent a lot of time writing code - instead of continuing to use brute force. At some point, as you've found, you hit a dead end and end up having to go back to the beginning - and now you have a lot more code to sift through!
I really can't say whether my guess is correct, or not. I've never tried to do what you're attempting using VBA. On occasion, I've created and used classes in VBA, but I've never tried passing object to another application where those object "reach back" and execute code within their classes. Especially not over Application.Run...
Usually, people put all the automation code in the one application (that would be Excel, in this case). The only time I might use Application.Run is to execute a fully independent macro in the other application (PowerPoint, in your case). It would never have occured to me to send across an object that's needs to "call back" into Excel. I'm not saying it's wrong - I simply have no experience with this approach and don't know.
In your position, with so much code that it's difficult to keep track of what's going on, I'd probably create a new Excel project with minimum functionality, to test the hypothesis. Just enough to duplicate the structures (a class with methods or whatever, object passed to PowerPoint, perform multiple iterations, etc.) and, with any luck, the problem. Of course, if the problem doesn't crop up then you can feel more certain that it's a coding error in the real project, rather than a problem with your approach.
Cindy Meister, VSTO/Word MVP, my blog
Friday, December 7, 2012 6:18 AM
Hi,
I am not an avid programmer and have been stuck with this error for a long time.I would really like to understand the root cause of this error and the method to resolve it. Here is my problem :
I have some VBA code distributed between Excel Workbook and a Power Point Template. I trigger my code from Excel, which in turn opens up the Power Point Template and calls some macros written inside it. The arguments that I pass to Power Point macros also include user defined objects(whose classes have been defined in the Excel VBA code), besides other datatypes. The Power Point macros perform the function of populating the charts and tables in the Power Point Template with data, that it has received as arguments from Excel.
The above explained process works fine and is carried out for multiple iterations. Problem starts occurring after certain number of iterations and the error which occurs is : "Automation Error System Call Failed ; Error No. 80010100 (-2147417856) ".
I tried finding out a workaround over this problem, by (a) Closing the Power Point Application after every iteration and reopening it. This I did through VBA Code in Excel. (b) I wrote a VB Script which calls the main Excel VBA macro that was triggering the process. It keeps a track of number of iterations completed and whenever the error occurs it closes the Excel Application and reopens it and then calls the Excel Macro ensuring that the process is resumed from the point(i.e iteration no.) where it failed .
Unfortunately, my VB Script also fails after performing its function a certain number of times and the error that it throws is again: "System Call Failed ; Error No. 80010100".
I suspect that the problem might be system dependent, because my code gives different performance on different systems, but dosen't fair successfully on any of them.Please HELP !!!
Friday, December 7, 2012 8:44 AM
A pity for you, this forum is for VB in Visual Studio Net.
But don't worry, you can ask this in the forum for Visual Studio Net for Office
http://social.msdn.microsoft.com/Forums/en-US/vsto
Success
Cor
Friday, December 7, 2012 9:03 AM | 1 vote
I've worked with both Excel and Power Point VBA. I don't like using late bindings because of errors like yours. Errors starting with 0x8 are either file permission problems or invalid pointers. I would start by adding some code to check for null objects. The code is probably looking for a slide with a particular name and not finding the slide which will return a null.
I like adding the reference object for Power Point into the excel project and using DIM statement to set all variable used in power point. Your code is probably using late bindings which makes the code hard to debug. Adding the reference library you wil be able to use early bindings by declaring the variable types with DIM statement making it easier to debug.
jdweng
Friday, December 7, 2012 10:09 AM
Thanks Joel for your suggestions, but I have ensured that all my variables in Power Point have been declared using DIM. Besides, I am also using early binding. Although I tried switching to late binding to check if that solves the problem, but it did not. Is it always advisable to use early binding for automation purposes ?
I know the code is correct, since it runs perfectly for certain iterations and starts failing only after a certain time.
Monday, December 10, 2012 2:29 AM
Hi,
You can refer to this page.
An experts says that
This error generally happens when you are trying to access an object whose instance is not present. For example, when you make a cut in a solid body, you might get more than 1 bodies. In this case, performing another cut on the earlier body object might result in automation error because the earlier object points to a body which does not exist now.
Hope it helps in understanding the problem
Regards,
Fermin
What's life without whimsy?
Tuesday, December 11, 2012 2:47 AM
Hi Akanshaa,
I'll move this thread to VSTO forum for better support.
Thanks for understanding.
Best regards,
Shanks Zen
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Tuesday, December 11, 2012 7:08 AM
As VBA is the programming language involved, VSTO is not the correct forum for this question - VSTO is a .NET technology. Therefore, I'm moving this along to the General Office Development forum which is language agnostic.
Cindy Meister, VSTO/Word MVP, my blog
Tuesday, December 11, 2012 7:29 AM | 1 vote
Hi Akanshaa
Are you able to detect whether it's always a certain line of code that's failing?
It might be helpful to see whether your code is correctly releasing all the objects involved. This is especially critical if you're passing objects to PowerPoint. COM can get pretty "upset" if objects aren't handled properly. Something that fails on multiple iterations often involves a problem of this nature. Are you carefully setting all object to Nothing when you're done with them?
You say you've tried having your code quit the applications and restart them. Have you checked in the task manager that they're actually cleared from memory? If there are objects "hanging" you'll often find that, while you may no longer see that application a stub is still held in memory due to unresolved objects.
Cindy Meister, VSTO/Word MVP, my blog
Tuesday, December 11, 2012 11:35 AM
Hey Cindy,
Thanks for that insight. I think your guess could be correct. I have already tried setting all objects to Nothing, but it being a very vast code, I might have missed it out at some places. Besides, I am sure that different lines of code fail at every time.
Regarding quitting of applications:
I first tried closing only Power Point from within Excel Code after each iteration, using "Application.Quit". This line of code did not seem to work for me. So I used some piece of code (from internet) which uses WMI (Windows Management Instrumentation) to query all running processes and then terminates all instances of the specified process. This worked and I was able to close the Power Point Application. But I was still getting the Automation Error.
Next, I wrote a VB Script that would close Excel Application on the occurance of error and restart the from next iteration-index. Here also I was using "Application.Quit" and was still getting the same Automation Error. I checked the task manager and observed exactly what you have mentioned. I used to get the error where I was trying to save and close the Excel Workbook. So I then changed the method of closing the application: instead of using application.Quit I used the same code (using WMI) that I took from internet to close Excel. Surprisingly, it worked !!!
1. Does this conclude that there are some objects "hanging" like you mentioned and I am force fully closing the Applications, which clears some kind of COM queue, which was otherwise getting overflowed ?
2. Besides, I wanted to know how do the user defined objects which I have passed to Power Point work. When I am accessing some property/function of the classes(defined in Excel VBA) of these objects from within the Power Point VBA, does the control of the code go back to Excel VBA ? Could this be an issue ?