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

Excel data viewing only ... no save

How do I open excel with data in it with out saving the file first. Similar to just a viewer.

4 Replies

LM Louise Mitchell September 13, 2006 03:09 AM UTC



>How do I open excel with data in it with out saving the file first. Similar to just a viewer.

Dim objXMLDoc As New XmlDocument
Dim objFileNodes As System.Xml.XmlNodeList
Dim objFileNode As System.Xml.XmlNode

Dim excelEngine As ExcelEngine = New ExcelEngine()

Dim application As IApplication = excelEngine.Excel

Dim strFilename As String = "myfile.xls"
Dim workbook As IWorkbook = application.Workbooks.Open(strFilename)


Dim sheet As IWorksheet = workbook.Worksheets(0)


MW Melba Winshia Syncfusion Team September 13, 2006 10:41 AM UTC

Hi Amy,

Thank you for using Syncfusion Essential XlsIO. Use the following code snippets to open spreadsheets with data in it.

[C#]

//New instance of XlsIO is created.[Equivalent to launching MS Excel with no workbooks open].
//The instantiation process consists of two steps.

//Step 1 : Instantiate the spreadsheet creation engine.
ExcelEngine excelEngine = new ExcelEngine();
//Step 2 : Instantiate the excel application object.
IApplication application = excelEngine.Excel;

//Opening the Worksheet from Existing Workbook.
IWorkbook workbook = application.Workbooks.Open(@"..\..\Opening.xls");

[VB]

''New instance of XlsIO is created.[Equivalent to launching MS Excel with no workbooks open].
''The instantiation process consists of two steps.

''Step 1 : Instantiate the spreadsheet creation engine.
Dim excelEngine As ExcelEngine = New ExcelEngine()
''Step 2 : Instantiate the excel application object.
Dim application As IApplication = excelEngine.Excel

''Opening the Worksheet from Existing Workbook.
Dim workbook As IWorkbook = application.Workbooks.Open("..\..\Opening.xls")



Here is a sample for your reference:


Opening.zip


Please take a look at the sample above and let me know if you have any other questions.

Thanks,
Melba


AD Administrator Syncfusion Team September 13, 2006 03:00 PM UTC

Your code runs but the problem is that it requires a call to SaveAs("Sample.xls") I have to avoid this and just open a workbook without saving it first. I want to create a workbook and display it without saving it anywhere. When the user closes it have it ask if they would like to save it, if not it throws it away without leaving any trace of it on the system.


MW Melba Winshia Syncfusion Team September 14, 2006 08:46 AM UTC

Hi Amy,

Currently we do not provide support to create a workbook and display it without saving it anywhere. Sorry for the inconvenience.

Please let me know if you have any other questions.

Thanks,
Melba

Loader.
Live Chat Icon For mobile
Up arrow icon