We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Open file xls from asset

Hi,

Is there a possibility to open an Excel file directly from Asset folder with XlslOS on a UWP platform  and this code ?

//Create an instance of ExcelEngine. using (ExcelEngine excelEngine = new ExcelEngine())
{             
//Open an existing workbook. IWorkbook workbook = excelEngine.Excel.Workbooks.Open(@"ms-appx:///Assets/Calendrier2017.xls");

//Access the first worksheet from the workbook instance. IWorksheet worksheet = workbook.Worksheets[0];

//Read/access the value of the cell (B3) textBox1.Text = worksheet["B3"].Text;
}

Thank you for your help

2 Replies

PI PINEAU December 20, 2016 07:31 AM UTC

Precision it's just to read the file not to modify it

Thank you for your help


SS Sridhar Sukumar Syncfusion Team December 21, 2016 12:05 PM UTC

Hi Pineau, 
  
Thank you for contacting Syncfusion support. 
  
Documents cannot be opened directly from Asset folder in UWP platform. Please follow the below steps to open documents in UWP platform. 
  
1.     Add the document (Excel document) into Embedded Resource. 
2.     Create stream for the document. 
3.     Open the stream using Workbook.OpenAsync(stream) method. 
  
We have also prepared a sample for this which can be downloaded from the following location 
  
  
Regards, 
Sridhar S. 


Loader.
Live Chat Icon For mobile
Up arrow icon