
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)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