Workbook.RemoveCustomization Method (2007 System)

Removes the Visual Studio Tools for Office customization from the workbook.

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

Syntax

'Declaration
Public Sub RemoveCustomization
'Usage
Dim instance As Workbook

instance.RemoveCustomization()
public void RemoveCustomization()
public:
void RemoveCustomization()
public function RemoveCustomization()

Exceptions

Exception Condition
CannotRemoveCustomizationException

The custom document properties or the cached data could not be removed from the workbook.

UnauthorizedAccessException

The document is protected.

Remarks

This method removes the customization by performing the following tasks:

  • It deletes the _AssemblyName and _AssemblyLocation custom properties from the workbook. For more information, see Custom Document Properties Overview.

  • It deletes the cached data from the workbook. For more information about cached data, see Caching Data.

This method might throw an UnauthorizedAccessException if the workbook is protected. You should remove any protection from the workbook before calling this method.

.NET Framework Security

See Also

Reference

Workbook Class

Workbook Members

Microsoft.Office.Tools.Excel Namespace

Other Resources

How to: Remove Managed Code Extensions from Documents (2007 System)

Caching Data

Custom Document Properties Overview