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.
Unfortunately, activation email could not send to your email. Please try again.

Excel data viewing only ... no save

Thread ID:

Created:

Updated:

Platform:

Replies:

49184 Sep 12,2006 05:55 PM Sep 14,2006 04:46 AM Windows Forms 4
loading
Tags: XlsIO
Administrator [Syncfusion]
Asked On September 12, 2006 05:55 PM

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

Louise Mitchell
Replied On September 12, 2006 11:09 PM



>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)

Melba Winshia [Syncfusion]
Replied On September 13, 2006 06:41 AM

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

Administrator [Syncfusion]
Replied On September 13, 2006 11:00 AM

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.

Melba Winshia [Syncfusion]
Replied On September 14, 2006 04:46 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;