HRESULT 0x800AC472 Exception

No Comments

What does this error say?

This error simply says that Excel is not ready to accept new commands from external. This happens when user is interacting with Excel (for example with Editing a Cell pressing F2). In such state Excel is not able to receive other commands. This is implemented to avoid overrides etc. You can check official reply from Microsoft Support team here. Full Thread can be found here, read this thread if you want to understand this in detail.

Possible Effects

Assume you export big amount of data to excel and you see some gaps: this problematic might be the reason of this situation. We recommend you to use Array functions to export big data

How to solve?

This code isn´t a bug nor error. This code simply try to avoid you from a bad situation. There is nothing you have done wrong, there is nothing XLSgate has done wrong, there is nothing Excel has done wrong. This code is thrown to tell you, you have to re-act! Almost all XLSgate functions return a boolean value, they will return TRUE in case of success otherwise they will return FALSE. Like suggested from Microsoft, you from-your-code need to re-send data upon error. We dont recommend doing this in very agrassive loop but in soft loop. Main reason why almost all functions return boolean return value is exactly to cover such situations. You will need to catch this situation from your code and re-act.

For example you could store all data which has returned False and send again afte x seconds from client. This algoritm needs to be designed on code-side. Sometimes its not important to re-send data, this applies for example when you stream live data to 1 cell, in such case you dont need to send previous price again. You will need to judge the situation based on your setup and re-act.