Opening Workbook

Hi,


I have a c# application. At the moment I open an excel file using this code:

var myWorkbook = new WorkBook(“C:\template.xlsx”);

This is working fine. However I have since decided that a more robust solution would be to add the excel as a resource to the project.

So my question is how can I open this resource file?

TIA.

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

If you want to open a file from resource, then you will need to open file using stream. Place your source file into resource stream and then open the file using stream.

Please see the following document how to open file using stream.

http://www.aspose.com/docs/display/cellsnet/Opening+Files

Hello,


Would it be possible to get an example of how you get from a resource to a stream.

I’ve tried numerous ways but I cannot seem to get it to work.

Many Thanks.

Hi,

Thanks for your posting and using Aspose.Cells.

Please check the following article. It explains how to embed and access resources by using Visual C#. You can also search on the google to find similar articles.


http://support.microsoft.com/kb/319292