Hi,
I am using the sample code provided in the following ASPOSE link to extract embedded ‘Microsoft Excel 97-2003 Worksheet’ from a MS Outlook message (.msg) in HTML format:
The only changes I have made are as follows:
1. I am reading the stream named “Workbook” instead of “CONTENTS” for Excel 97-2003.
CFStream contents = cf.RootStorage.GetStream(“Workbook”);
2. I am saving the file with extension ‘.xls’
using (FileStream fs = File.OpenWrite(index + “.xls”))
The code is working fine and not generating any error or throwing any exception. But when I am trying to open the extracted file using MS Excel, it’s throwing an error “Microsoft Excel has stopped working”. Please find a screenshot with problem details attached.
The strange thing is that I can open the file after repair. Can you please investigate the issue and let me know how to solve it. The above code works fine for ‘.pdf’ or ‘.xlsx’ attachments.
Thanks in advance.
Best regards,
Bitan
Hi Bitan,
Thank you for sharing your concerns.
I am able to observe this issue with the code from the sample article. However, I would request you to please spare us a little time to investigate the issue in further details for extraction of embedded objects. I'll soon share my feedback with you in this regard.
Hi again Kashif,
Thank you for the quick response.
Please take your time to investigate this issue and let me know if you need any clarification from my end. I will wait for your feedback.
Best regards,
Bitan
Hi Bitan,
I have re-produced the error where extracted xls file causes error “Microsoft Excel has stopped working”. I have also tested that it works fine with PDF. However I could not re-produce the scenario where it works fine with XLSX file. I have tried by creating a message with HTML body and inline XLSX however, above mentioned code with the following statement is raising exception:
CFStream contents = cf.RootStorage.GetStream(“Workbook”);
Could you please provide some sample MSG file with inline XLSX file or steps to create such message? It will help us to analyze the problem and provide you assistance.
Thanks in advance for your cooperation.
Hi Bitan,
Thank you for the feedback.
I am afraid to share that I couldn’t find any solution for this issue with the suggested method on our website. For further assistance in this regard, I’ve forwarded your request you to our development team and will write back here as soon as some information is available in this received. We appreciate your patience in this regard.
Hi Kashif,
Thanks for looking in this issue in detail and forwarding my concern to the development team. I will wait for any update from them. Please let me know when you receive some feedback on this.
If you guess that this problem is not for ASPOSE and may be due to the use of OpenMCDF library, then you can suggest me some other libraries for parsing Microsoft Computer Document File (MCDF) file. I will happily give those a try.
Thanks again.
Best regards,
Bitan
Hi Bitan,
I am afraid to share that I couldn’t get to any other .NET library that could be used for this purpose, and will request you to spare us some time so as to get the feedback from our development team in this regard. I"ll update you via this thread as soon as information is available in this regard.