WorksheetBase Class

Provides the base class for the Sheetn classes in document-level projects for Microsoft Office Excel.

System.Object
  Microsoft.Office.Tools.Excel.WorksheetBase

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

public abstract class WorksheetBase : IWorksheetExtension, 
	IExtension, EntryPoint, ISupportInitialize, IBindableComponent, IComponent, 
	IDisposable

The WorksheetBase type exposes the following members.

  NameDescription
Protected methodWorksheetBaseInfrastructure.
Top

  NameDescription
Public property_CodeNameInfrastructure.
Public property_DisplayRightToLeftInfrastructure.
Public propertyApplicationGets a Microsoft.Office.Interop.Excel.Application object that represents the Microsoft Office Excel application.
Public propertyAutoFilterGets a Microsoft.Office.Interop.Excel.AutoFilter that provides information about filtered lists on the worksheet if filtering is enabled. Gets null if filtering is off.
Public propertyAutoFilterModeGets or sets a value that indicates whether filtering is currently enabled on the worksheet (that is, whether the filter drop-down arrows are currently displayed).
Public propertyBaseGets the Worksheet object that this WorksheetBase object extends.
Public propertyBindingContextInfrastructure.
Public propertyCellsGets a Range object that represents all the cells on the worksheet (not just the cells that are currently in use).
Public propertyCircularReferenceGets a Range object that represents the range containing the first circular reference on the sheet, or gets null if there is no circular reference on the sheet.
Public propertyCodeNameInfrastructure.
Public propertyColumnsGets a Range object that represents one or more columns on the worksheet.
Public propertyCommentsGets a Microsoft.Office.Interop.Excel.Comments collection that represents all the comments for the worksheet.
Public propertyConsolidationFunctionGets the function code used for the current consolidation.
Public propertyConsolidationOptionsGets a three-element Array of consolidation options.
Public propertyConsolidationSourcesGets an Array of strings that name the source sheets and ranges for the worksheet's current consolidation.
Public propertyControlsGets the collection of managed controls that are contained on the worksheet.
Public propertyCreatorGets a value that indicates the application in which the worksheet was created.
Public propertyCustomPropertiesGets a Microsoft.Office.Interop.Excel.CustomProperties object representing the identifier information associated with a worksheet.
Public propertyDataBindingsInfrastructure.
Public propertyDataHostInfrastructure.
Public propertyDisplayAutomaticPageBreaksInfrastructure.
Public propertyDisplayPageBreaksGets or sets a value that indicates whether page breaks (both automatic and manual) on the worksheet are displayed.
Public propertyDisplayRightToLeftGets or sets a value that indicates whether the worksheet is displayed from right to left instead of from left to right.
Public propertyEnableAutoFilterGets or sets a value that indicates whether AutoFilter arrows are enabled when user-interface-only protection is turned on.
Public propertyEnableCalculationGets or set a value that indicates whether Microsoft Office Excel automatically recalculates the worksheet when necessary.
Public propertyEnableFormatConditionsCalculationGets or sets a value that determines whether conditional formats will occur automatically.
Public propertyEnableOutliningGets or sets a value that indicates whether outlining symbols are enabled when user-interface-only protection is turned on.
Public propertyEnablePivotTableGets or sets a value that indicates whether PivotTable controls and actions are enabled when user-interface-only protection is turned on.
Public propertyEnableSelectionGets or sets a value indicating which cells can be selected on the sheet.
Public propertyFilterModeGets a value that indicates whether the worksheet is actively filtering data.
Public propertyHostContextInfrastructure.
Public propertyHPageBreaksGets an Microsoft.Office.Interop.Excel.HPageBreaks collection that represents the horizontal page breaks on the sheet.
Public propertyHyperlinksGets a Microsoft.Office.Interop.Excel.Hyperlinks collection that represents the hyperlinks for the range or worksheet.
Public propertyIndexGets the index number of the worksheet within the collection of worksheets.
Public propertyInnerObjectGets a Microsoft.Office.Interop.Excel.Worksheet that represents the underlying native object for the WorksheetBase.
Public propertyItemProviderInfrastructure.
Public propertyListObjectsGets a collection of Microsoft.Office.Interop.Excel.ListObject objects in the worksheet.
Public propertyMailEnvelopeGets an e-mail header for the worksheet.
Public propertyNameGets or sets the name of the worksheet.
Public propertyNamesGets a Microsoft.Office.Interop.Excel.Names collection that represents all the worksheet-specific names (names defined with the "WorksheetName!" prefix).
Public propertyNextGets a Microsoft.Office.Interop.Excel.Worksheet that represents the next sheet.
Public propertyOnCalculateInfrastructure.
Public propertyOnDataInfrastructure.
Public propertyOnDoubleClickInfrastructure.
Public propertyOnEntryInfrastructure.
Public propertyOnSheetActivateInfrastructure.
Public propertyOnSheetDeactivateInfrastructure.
Public propertyOutlineGets an Microsoft.Office.Interop.Excel.Outline that represents the outline for the worksheet.
Public propertyPageSetupGets a Microsoft.Office.Interop.Excel.PageSetup that contains all the page setup settings for the worksheet.
Public propertyParentGets the parent object for the worksheet.
Public propertyPreviousGets a Microsoft.Office.Interop.Excel.Worksheet that represents the previous sheet.
Public propertyPrintedCommentPagesGets the number of comment pages that will be printed for the current worksheet. This property can be used only in Excel 2010 projects.
Public propertyProtectContentsGets a value that indicates whether the contents of the worksheet (the individual cells) are protected.
Public propertyProtectDrawingObjectsGets a value that indicates whether shapes are protected.
Public propertyProtectionGets a Microsoft.Office.Interop.Excel.Protection object that represents the protection options of the worksheet.
Public propertyProtectionModeGets a value that indicates whether user interface-only protection is turned on.
Public propertyProtectScenariosGets a value that indicates whether worksheet scenarios are protected.
Public propertyQueryTablesGets the Microsoft.Office.Interop.Excel.QueryTables collection that represents all the query tables on the worksheet.
Public propertyRangeGets a Microsoft.Office.Interop.Excel.Range object that represents a cell or a range of cells.
Public propertyRowsGets a Range object that represents one or more rows on the worksheet.
Public propertyScriptsGets the Microsoft.Office.Core.Scripts collection, which contains Script objects representing blocks of script or code in the worksheet when it is saved as a Web page.
Public propertyScrollAreaGets or sets the range where scrolling is allowed, as an A1-style range reference.
Public propertyShapesGets a Microsoft.Office.Interop.Excel.Shapes object that represents all the shapes on the worksheet.
Public propertySiteInfrastructure.
Public propertySmartTagsGets a Microsoft.Office.Interop.Excel.SmartTags object representing the collection of smart tags for the worksheet.
Public propertySortGets the sorted values in the current worksheet.
Public propertyStandardHeightGets the standard (default) height of all the rows in the worksheet, in points.
Public propertyStandardWidthGets or sets the standard (default) width of all the columns in the worksheet.
Public propertyTabGets a Microsoft.Office.Interop.Excel.Tab for the worksheet.
Public propertyTagGets or sets the object that contains data about the worksheet.
Public propertyTransitionExpEvalGets or sets a value that indicates whether Microsoft Office Excel uses Lotus 1-2-3 expression evaluation rules for the worksheet.
Public propertyTransitionFormEntryGets or sets a value that indicates whether Microsoft Office Excel uses Lotus 1-2-3 formula entry rules for the worksheet.
Public propertyTypeGets the worksheet type.
Public propertyUsedRangeGets a Microsoft.Office.Interop.Excel.Range object that represents all the cells that have contained a value at any time.
Public propertyVisibleGets or sets a Microsoft.Office.Interop.Excel.XlSheetVisibility value that determines whether the object is visible.
Public propertyVPageBreaksGets a Microsoft.Office.Interop.Excel.VPageBreaks collection that represents the vertical page breaks on the sheet.
Top

  NameDescription
Public methodActivateInfrastructure.
Public methodArcsInfrastructure.
Public methodBeginInitInfrastructure.
Public methodButtonsInfrastructure.
Public methodCalculateMethodCalculates the formulas in the worksheet.
Public methodChartObjectsGets an object that represents either a single embedded chart (a Microsoft.Office.Interop.Excel.ChartObject) or a collection of all the embedded charts (a Microsoft.Office.Interop.Excel.ChartObjects) on the worksheet.
Public methodCheckBoxesInfrastructure.
Public methodCheckSpellingInfrastructure.
Public methodCircleInvalidCircles invalid entries on the worksheet.
Public methodClearArrowsClears the tracer arrows from the worksheet. Tracer arrows are added by using the auditing feature.
Public methodClearCirclesClears circles from invalid entries on the worksheet.
Public methodCopyCopies the worksheet to another location in the workbook.
Public methodDeleteDeletes the underlying Microsoft.Office.Interop.Excel.Worksheet object, but does not delete the host item. It is highly recommended that this method not be used.
Public methodDisposeReleases all resources used by the current instance of the WorksheetBase class.
Public methodDrawingObjectsInfrastructure.
Public methodDrawingsInfrastructure.
Public methodDropDownsInfrastructure.
Public methodEndInitInfrastructure.
Public methodEqualsDetermines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public methodEvaluateConverts a Microsoft Office Excel name to an object or a value.
Public methodExportAsFixedFormatExports to a file of the specified format.
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Protected methodFinishInitializationInfrastructure.
Public methodget_RangeGets a Microsoft.Office.Interop.Excel.Range object that represents a cell or a range of cells. Use the Range property instead of this method.
Protected methodGetAutomationObjectCalled by the Visual Studio Tools for Office runtime to get an object that can be used by VBA code in the worksheet.
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodGroupBoxesInfrastructure.
Public methodGroupObjectsInfrastructure.
Protected methodInitializeInfrastructure.
Protected methodInitializeDataBindingsInfrastructure.
Public methodLabelsInfrastructure.
Public methodLinesInfrastructure.
Public methodListBoxesInfrastructure.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodMoveMoves the worksheet to another location in the workbook.
Public methodOLEObjectsGets an object that represents either a single OLE object (an Microsoft.Office.Interop.Excel.OLEObject) or a collection of all OLE objects (an Microsoft.Office.Interop.Excel.OLEObjects collection) on the worksheet.
Protected methodOnShutdownInfrastructure.
Protected methodOnStartupInfrastructure.
Public methodOptionButtonsInfrastructure.
Public methodOvalsInfrastructure.
Public methodPastePastes the contents of the Clipboard onto the worksheet.
Public methodPasteSpecialPastes the contents of the Clipboard onto the worksheet, using a specified format. Use this method to paste data from other applications or to paste data in a specific format.
Public methodPicturesInfrastructure.
Public methodPivotTablesGets an object that represents either a single PivotTable report (a Microsoft.Office.Interop.Excel.PivotTable object) or a collection of all the PivotTable reports (a Microsoft.Office.Interop.Excel.PivotTables object) on a worksheet.
Public methodPivotTableWizardCreates a Microsoft.Office.Interop.Excel.PivotTable object.
Public methodPrintOutPrints the worksheet.
Public methodPrintOutExPrints the worksheet.
Public methodPrintPreviewShows a preview of the worksheet as it would look when printed.
Public methodProtectProtects a worksheet so that it cannot be modified.
Public methodRectanglesInfrastructure.
Public methodResetAllPageBreaksResets all page breaks on the specified worksheet.
Public methodSaveAsSaves changes to the worksheet in a different file.
Public methodScenariosGets an object that represents either a single scenario (a Microsoft.Office.Interop.Excel.Scenario object) or a collection of scenarios (a Microsoft.Office.Interop.Excel.Scenarios object) on the worksheet.
Public methodScrollBarsInfrastructure.
Public methodSelectSelects the worksheet.
Public methodSetBackgroundPictureSets the background graphic for the worksheet.
Public methodShowAllDataMakes all rows of the currently filtered list visible. If AutoFilter is in use, this method changes the arrows to "All."
Public methodShowDataFormDisplays the data form associated with the worksheet.
Public methodSpinnersInfrastructure.
Public methodTextBoxesInfrastructure.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodUnprotectRemoves protection from the worksheet. This method has no effect if the worksheet is not protected.
Public methodXmlDataQueryGets a Range object that represents the cells mapped to a particular XPath. Gets null if the specified XPath has not been mapped to the worksheet, or if the mapped range is empty.
Public methodXmlMapQueryGets a Range object that represents the cells mapped to a particular XPath. Gets null if the specified XPath has not been mapped to the worksheet.
Top

  NameDescription
Public eventActivateEventOccurs when the worksheet is activated.
Public eventBeforeDoubleClickOccurs when the worksheet is double-clicked, before the default double-click action.
Public eventBeforeRightClickOccurs when the worksheet is right-clicked, before the default right-click action.
Public eventBindingContextChangedInfrastructure.
Public eventCalculateOccurs after the worksheet is recalculated.
Public eventChangeOccurs when something changes in the WorksheetBase cells.
Public eventDeactivateOccurs when the worksheet loses focus.
Public eventDisposedInfrastructure.
Public eventFollowHyperlinkOccurs when you click any hyperlink on a worksheet.
Public eventPivotTableAfterValueChangeOccurs after a cell or range of cells inside a PivotTable are edited or recalculated (for cells that contain formulas). This event can be used only in Excel 2010 projects.
Public eventPivotTableBeforeAllocateChangesOccurs before changes are applied to a PivotTable. This event can be used only in Excel 2010 projects.
Public eventPivotTableBeforeCommitChangesOccurs before changes are committed against the OLAP data source for a PivotTable. This event can be used only in Excel 2010 projects.
Public eventPivotTableBeforeDiscardChangesOccurs before changes to a PivotTable are discarded. This event can be used only in Excel 2010 projects.
Public eventPivotTableChangeSyncOccurs after changes to a PivotTable. This event can be used only in Excel 2010 projects.
Public eventPivotTableUpdateOccurs after a PivotTable report is updated on a worksheet.
Public eventSelectionChangeOccurs when the selection changes on a worksheet.
Public eventShutdownOccurs when the worksheet host item shuts down.
Public eventStartupInfrastructure.
Top

The WorksheetBase class is the base class for the Sheetn classes in document-level Excel projects created by using Visual Studio. Use the Sheetn classes to programmatically access the worksheets in your project. The WorksheetBase class is a host item that represents a worksheet in document-level projects. For more information, see Host Items and Host Controls Overview and Worksheet Host Item.

The WorksheetBase class provides the same members as the Microsoft.Office.Interop.Excel.Worksheet class in the Excel primary interop assembly, but it adds the following features:

Creating Worksheet Host Items

You cannot create WorksheetBase objects programmatically in Office projects.

In document-level projects, the Sheetn classes (which derive from WorksheetBase) are instantiated automatically by the Visual Studio Tools for Office runtime when the end user opens the workbook. For more information, see Programming Document-Level Customizations.

In application-level projects, you can create worksheet host items programmatically by using the GetVstoObject method. The worksheet host item you create is a Microsoft.Office.Tools.Excel.Worksheet object, rather than a WorksheetBase object. For more information, see Extending Word Documents and Excel Workbooks in Application-Level Add-ins at Run Time.

Usage

This type is used only in Office projects that target the .NET Framework 4. The assembly that defines this type is not part of the Visual Studio Tools for Office runtime. You must deploy this assembly with your solution. For more information, see Assemblies in the Visual Studio Tools for Office Runtime.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft