Hi,
I am trying to embed an excel file inside another excel in my .net application.
I am able to achieve this with IOleObject Add(string fileName, Image image, OleLinkType linkType)
This embedded file is stored as binary object. Storage name = "oleObject4.bin"
I am looking to save this as an .xls, so it becomes easy to extract it in my app later. Extraction code looks for an embedded .xls file but only finds a .bin instead.
So far I have not found any answer to this question.
I would really rather save/embed it as an .xls to begin with, than change the extraction code to convert .bin into .xls
Any help is apriciated.
Thank You
Hi Keerthi,
Thank you for your reply.
The issue is that we are using legacy .Net app. (Framework 4.7.2)
The method used in sample code which uses OleObjectType seems to only supported in UWP, ASP.NET Core and Xamarin.
I tried searching anything similar for .net 4.7.2 but couldn't find anything.
Is it possible to convert this .bin file back to excel ?
I tried using filestream to extract the embedded excel from oleobject which is in .bin format. Then use MemoryStream to copy it out into a temp .xls. But, when I try to convert it back to .xls it does not work. I get the following exception:
| Name | Value | Type | |
|---|---|---|---|
| ▶ | $exception | {"Zip exception.Unable to read value at the specified position - end of stream was reached."} | Syncfusion.Compression.Zip.ZipException |
Is there a way to know how i can manually change this .bin back to .xls?
Or is there some methods I can use which are also available in .net 4.7.2?
Thank You,
Pushkar