SQL Server 2022, Visual Studio 2022 - Microsoft VB 2022 script task interacting with Excel COM Errors

Guilfoy, Kristy 20 Reputation points
2025-10-31T20:27:55.9566667+00:00

We have some SSIS packages that interact with Excel files. The SSIS packages output the data to the excel spreadsheets that include a template row so that numbers are formatted as numbers.. etc. There are also pivot tables that exist on other tabs of the workbooks. We have script tasks that open the spreadsheet, delete the 2nd row and then do a RefreshAll() to update the pivot tables to look at the new data. We are experiencing errors as soon as the code hits the script task. I should also add that we have Microsoft Office LTSC Professional Plus 2024 installed on the server. We also have the Microsoft Access Database Engine 2016 installed.

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:

Element not found. (Exception from HRESULT:

0x8002802B (TYPE_E_ELEMENTNOTFOUND)).

Also this error:

The message filter indicated that the

application is busy. (Exception from HRESULT:

0x8001010A (RPC_E_SERVERCALL_RETRYLATER))

We have tried many troubleshooting steps so I'm not really sure where to start at this point. Hoping someone can help!

SQL Server Integration Services
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 81,281 Reputation points Volunteer Moderator
    2025-11-01T17:24:32.36+00:00

    Office interop is not officially supported from system services, only desktop apps. The service calling interop must load a user profile (service accounts typically don’t).

    https://support.microsoft.com/en-us/topic/considerations-for-server-side-automation-of-office-48bcfe93-8a89-47f1-0bce-017433ad79e2

    there are hacks to get it working (google), but it will never be reliable.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.