


HOW TO REMOVE DOCUMENT INSPECTOR IN EXCEL CODE
The following sample code shows how you would loop through all. □ If the Fix method of the DocumentInspector object fails as a result of the workbook containing protected worksheets, or for any other reason, it will simply return an error code and description of the problem rather than causing a VBA run-time error. There is no way to limit the removal to headers or footers alone. For example, if you choose to remove headers and footers using the DocumentInspector object designed for that purpose, all headers and footers in all worksheets in the workbook will be removed. □ Using the Fix method of the DocumentInspector object to remove affected information is an all-or-nothing process. □ The DocumentInspector object has an Inspect method that can be used to passively determine whether a workbook contains any information that would be removed by the object, without actually doing so. These differences are summarized as follows: There are a number of differences between capabilities of the RemoveDocumentInformation method and the DocumentInspector object. Individual DocumentInspector objects can only be accessed by index number from the DocumentInspectors collection, or by iterating the entire collection with a For.Each loop. These features and their corresponding index numbers in the DocumentInspectors collection are shown here: The DocumentInspectors collection of the Workbook object contains a group of DocumentInspector objects that provide a VBA interface to the features exposed by the last five sections of the Document Inspector user interface.
