Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example imports an Excel-formatted file into an fpSpread control in Microsoft Visual InterDev. The page provides a button that imports an existing file. The following code belongs in the button's event.

To access the file used in this sample, change the path in the code to the path for your product installation's \SAMPLES\FILES directory.

Visual
InterDev

dim listcount,handle
dim List()
dim sheet

fpSpread1.ScriptEnhanced=true

fpSpread1.IsExcelFile("C:\Samples\Files\quotes.XLS")

' returns number of sheets as ListCount
fpSpread1.ScriptGetExcelSheetList("C:\Samples\Files\quotes.XLS ", Null, listcount, "C:\Samples\Files\quotes.log", handle, true)

ReDim List(listcount)
' returns sheet names in List
fpSpread1.ScriptGetExcelSheetList("C:\Samples\Files\quotes.XLS", List, listcount, "C:\Samples\Files\quotes.log", handle, true)
sheet=List(0)
fpSpread1.ImportExcelSheet(cint(handle), sheet)

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.