The SpreadsheetGear API is familiar to developers with experience using Microsoft Excel(TM) VBA or COM. In many cases, the SpreadsheetGear API is close enough to the Excel API that you can record a macro in Excel to learn which properties or methods to use in SpreadsheetGear.
Major differences between SpreadsheetGear and Excel include:
- In most cases, SpreadsheetGear uses interfaces rather than classes. Use SpreadsheetGear.IWorkbook instead of Microsoft.Office.Interop.Excel.Workbook.
-
SpreadsheetGear integer indexes for workbooks, worksheets, rows, columns, etc... are zero based while Excel indexes are generally one based.
-
Many formatting properties (such as
IRange.Font.Color) in Excel return
System.Object. This is done so that
null may be returned if all of the represented cells and objects do not have the same value for the particular property. Unfortunately, this bypasses type safety at compile time and causes unnecessary complexity for the vast majority of use cases. SpreadsheetGear improves on this by returning the appropriate type (such as
SpreadsheetGear.Color), and providing a separate boolean property (such as
IRange.Font.ColorDefined) which specifies whether all represented cells/objects have the same value for the property in question.
-
Enumerations leave out
XL on enumeration type names and the leading
xl on enumeration identifiers. Use
SpreadsheetGear.SheetType.Worksheet instead of
Microsoft.Office.Interop.Excel.XLSheetType.xlWorksheet.
-
-
-
When using the SpreadsheetGear Windows Forms, WPF and Silverlight Controls with interruptible background calculation enabled,
GetLock and
ReleaseLock must be used. See
GetLock and ReleaseLock for more information.
- When the SpreadsheetGear Help is installed, Visual Studio's IntelliSense and Dynamic Help provide context sensitive help which simplifies development.