web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

2015 Onpremises - Excel Error "Could not load type 'Microsoft.Office.Interop.Excel._Worksheet' from assembly.The type is marked as eligible for type equivalence, but the containing assembly is not loaded as fully trusted."

(0) ShareShare
ReportReport
Posted on by

Hi Experts,

I am working on 2015 on-premises and have a requirement where I need to copy data from a custom entity to excel sheet with custom header names depending on business requirement.

I added "Microsoft Excel 15.0 Object Library" reference to project. Microsoft.Office.Interop.Excel precisely.

At time of plug in execution I am getting an error

"Could not load type 'Microsoft.Office.Interop.Excel._Worksheet' from assembly.The type is marked as eligible for type equivalence, but the containing assembly is not loaded as fully trusted."

Tried registering the plug in on both sand box and none mode, but the error is same.

Please let me know where I am doing wrong, or are there any more points to be considered with new version.

Regards,

Harry.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Bas van de Sande Profile Picture
    4,383 on at

    Hi Harry,

    if you refer to external dll's from within your assembly, then you need to use ILMerge to merge your assembly with the external ones.

    A lot of the Microsoft DLL's are not fully trusted... so I would not bother in going that route.

    What you can do on the other hand is create a CSV file and save it as an xlsx (stream it back to the browser).

    I hope this helps you in the right direction

    Bas

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans