Click here to Skip to main content
15,886,592 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am using closed xml for data population in a predefined excel macro template file (xlsm) in sheet-1, along with that i have to insert PDF file as an object in sheet-2.
vb.net - Embed Object in the existing Excel Worksheet using ClosedXML - Stack Overflow[^]
Embed file(pdf,text,zip etc) in in excel · Issue #45 · ClosedXML/ClosedXML.Report · GitHub[^]
This describes ClosedXML is not supported for inserting OLE object

What I have tried:

c# - How can I embed any file type into Microsoft Word using OpenXml 2.0 - Stack Overflow[^]
Going to try this in excel macro and wanted to know anyone had implemented the same
Posted
Updated 22-Sep-22 11:01am
Comments
Maciej Los 31-Aug-20 7:52am    
What's the question?
[no name] 31-Aug-20 10:19am    
"Any" file type? I think you can embed a link; a whole file seems a stretch. I also think the result is called malware.
Lenin Mathi 1-Sep-20 4:10am    
how can i insert any file (preference is PDF) as a ole object in sheet-2.
am extracting the content from PDF file, so content will be available in sheet-1 and sheet-2 will have the respective file for reference to the user. Since the file may shared between the users internally, i think inserting it as link will not be right solution
Maciej Los 1-Sep-20 4:19am    
Please, use "Reply" widget to be sure that system will inform user about your reply.

The simplest way is to use Interop: OLEObjects.Add(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) Method (Microsoft.Office.Interop.Excel) | Microsoft Docs[^]

Nor ClosedXml, nor EPPlus does not support OleObject insertion. Aspose[^] can do it.
 
Share this answer
 
Como puedo incrustar objetos en un excel file con la libreria OpenXML es que Microsoft.Office.Interop.Excel me causo problemas al usbirlo al server :(
 
Share this answer
 
Comments
Richard Deeming 23-Sep-22 4:16am    
This is an English language site. And your question is not a "solution" to someone else's question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900