Spread Silverlight Documentation
OpenExcel(Stream,ExcelOpenFlags) Method
Example 


The file stream.
The flag used to open the file.
Opens an Excel Compound Document File and loads it into GcSpreadSheet.
Syntax
'Declaration
 
Public Overloads Sub OpenExcel( _
   ByVal stream As System.IO.Stream, _
   ByVal openFlags As ExcelOpenFlags _
) 
'Usage
 
Dim instance As GcSpreadSheet
Dim stream As System.IO.Stream
Dim openFlags As ExcelOpenFlags
 
instance.OpenExcel(stream, openFlags)
public void OpenExcel( 
   System.IO.Stream stream,
   ExcelOpenFlags openFlags
)

Parameters

stream
The file stream.
openFlags
The flag used to open the file.
Example
This example uses the OpenExcel method.
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Filter = "Excel File (.xlsx)|*.xlsx";
bool? useClick = openFileDialog.ShowDialog();
if (useClick == true)
{
    var stream = openFileDialog.File.OpenRead();
    stream.Seek(0, System.IO.SeekOrigin.Begin);
     gcSpreadSheet1.OpenExcel(stream);
    //gcSpreadSheet1.OpenExcel(stream, GrapeCity.Windows.SpreadSheet.Data.ExcelOpenFlags.DataOnly);
    //gcSpreadSheet1.OpenExcel(stream, GrapeCity.Windows.SpreadSheet.Data.ExcelOpenFlags.DataOnly, "12Test9");
    //gcSpreadSheet1.OpenExcel(stream, "12Test9");
    stream.Dispose();
}
Dim openFileDialog = New OpenFileDialog()
openFileDialog.Filter = "Excel File(.xlsx)|*.xlsx"
Dim useClick As Boolean = openFileDialog.ShowDialog()
If (useClick = True) Then
    Dim stream = openFileDialog.File.OpenRead()
    stream.Seek(0, IO.SeekOrigin.Begin)
    GcSpreadSheet1.OpenExcel(stream)
    'GcSpreadSheet1.OpenExcel(stream, GrapeCity.Windows.SpreadSheet.Data.ExcelOpenFlags.DataOnly)
    'GcSpreadSheet1.OpenExcel(stream, GrapeCity.Windows.SpreadSheet.Data.ExcelOpenFlags.DataOnly, "12Test9")
    'GcSpreadSheet1.OpenExcel(stream, "12Test9")
End If
Requirements

Target Platforms: Windows 7, Windows 8 Desktop, Windows Vista SP1 or later, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

Reference

GcSpreadSheet Class
GcSpreadSheet Members
Overload List

 

 


Copyright © GrapeCity, inc. All rights reserved.