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

Reading via stream

Hi, 
Is it better to read via stream or just give the path, and why?
IWorkbook wb = XlObj.Excel.Workbooks.Open(path);//like C:/test/XYZ.xlsx
OR
IWorkbook wb = XlObj.Excel.Workbooks.Open(stream);//like Stream stream =  FileStream(path, //FileMode.Open);

1 Reply

JM Johnson Monohar M Syncfusion Team May 14, 2012 12:54 PM UTC

Hi Amber,

Thank you for using Syncfusion products.

Either a stream or a filename can be used to open a workbook, as both does the same functionality which returns a workbook. Internally the file name creates a stream and processes its data. Whereas, if a stream is given as input, it processes from that stream itself. 

The stream option is given in addition for user's convenience to use the stream wherever necessary. If a user is not able to manage the code with streams, then can use a file name to open.

Please let us know if you need further clarification.

Regards,
Johnson

Loader.
Live Chat Icon For mobile
Up arrow icon