03-11-2015 12:05 PM
I encountered this problem recently and fought with it for a while and finally figured it out. I wanted to make note of this issue so that others can hopefully learn from my mistakes. Not sure if this is the best place for it but hey, why not.
TL;DR
Background
I was building a fairly simple data logging and control application for a customer. The software was supposed to collect data and generate a report to an Excel spreadsheet. No real problem right? I built the application and was able to simulating in my office before deploying it to the customers machine. We hit a snag when the computer that would be running the code didn't have Excel on it (whoops) we aranged for their IT guys to come in and install it for them and we could handle any troubelshooting remotely. I was confident in my code as I tested it with simulated data and knew it would operate correctly... famous last words.
The Errors
Once the customer got Excel up and running and tried to use the software I deployed he got error when generating his report. Since the report generation code was easly isolated from the rest of the program I was able to mock up a test application to isolate the problem better and we found that we were getting undefined error -2147352573. Searching through the ni.com the most likely candidate of this problem was incompatibility between their version of Excel (2007) and the version of the Report Generation Toolkit I deployed on their system (2013). The problem with this, was that Report Generation Toolkit 2013 is supposed to work with Excel 2007. Further investigation showed that the code was specifically erroring out while trying to apply the background colour to a cell.
The Solution
To resolve the issue I did the following:
I hope that helps people. I know the real anwser of "why is this happening" isn't really getting solved but as I mentioned this wasn't on my machine, it wasn' an environment that I could try everything or isolate all the conditions. My solution is more of a work around and comes from me spending (probably more) time with the customer remotely trying to solve the issue.
If anyone has any other questions please feel free to let me know.