I get this error when trying to use the Export to Excel function in Rapid Start.
A call to Microsoft.Dynamics.Nav.Integration.Office.Excel.ExcelHelper.CallOpen failed with this message:
Unable to cast COM object of type ‘Microsoft.Office.Interop.Excel.ApplicationClass’ to interface type ‘Microsoft.Office.Interop.Excel._Application’.
This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{000208D5-0000-0000-C000-000000000046}’ failed due to the following error:
Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
Hi Thomas,
More details please. NAV version, client, OS, same for Excel. And does it happen on other PC’s and/with other user id’s?
Any other problems with Excel integration?
I don’t know if this is the same case, this error can ocurr if there isn’t installed Excel in the computer, or the user have no permissions to use Excel. In my case, a client had installed LibreOffice and got this error.
The error apears in, exactly, the moment when tries to open excel (Function CallOpen)… You can change code to download file instead to try to open it.
This is a function I added to Excel Buffer to do that (NAV 2013R2):
DownloadExcel()
ClientFilename := 'Book1' + ExcelFileExtensionTok;
IF FileManagement.CanRunDotNetOnClient THEN BEGIN
ClientFilename := FileManagement.SaveFileDialog('Save file','',Text034);
IF ClientFilename = '' THEN
EXIT;
IF FileManagement.GetExtension(ClientFilename) = '' THEN
ClientFilename += ExcelFileExtensionTok;
END;
FileManagement.DownloadToFile(FileNameServer,ClientFilename);
The reason I ask, is that this kind of error typically is related to a somehow faulty installation, often related to Excel.
Checking that the other Excel exports, like exporting Rapid starts data export, works would show that that issue is not the installation.