title: SSIS Script Task fails when run from sql job
body: <p>I have a created a SSIS package to load excel file into database but before Data Flow Task, i m using a script task to change data type of one the excel columns using interop.excel dll.</p>
  
  <p>While running the package in VS2015 on the server itself, it completes with success, but when i am running it through sql server agent it is getting failed and giving following error message </p>
  
  <blockquote>
    <p>"Script Task Error : Exception has been thrown by the target of an
    invocation."</p>
  </blockquote>
  
  <p>i have already registered the dll in GAC.</p>
  
  <p>What others steps should i try to resolve the issue?</p>
  
  <p>Edit :- </p>
  
  <p>Error Message :</p>
  
  <blockquote>
    <p>Retrieving the COM class factory for component with CLSID
    {000209FF-0000-0000-C000-000000000046} failed due to the following
    error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005
    (E_ACCESSDENIED)).</p>
  </blockquote>