All posts by admin

Capture Excel Workbook Close, Worksheet Delete, Worksheet Rename Events

I created a C# class to handle some of missing Excel application level events such as : Workbook close, worksheet rename, worksheet delete, range name added, range name deleted, application activated, application deactivated.

Excel does offer a workbook closing event, but the user can cancel it. The workbook closed event fires when the workbook actually closes.

Usage is fairly straightforward :

ExcelApplicationEvents _appEvents = 
new ExcelApplicationEvents(_app, 
ApplicationEvents.WorkbookClosed);

_appEvents.WorkbookClosed += 
_appEvents_WorkbookClosed;

Get Microsoft Office Product Information using VBA

Created a class to get Microsoft Office Product Information using VBA.

Application.ProductCode returns a GUID containing multiple values including the release version, release type, major version, minor version product ID, and bitness (32-bit or 64-bit) among others.

The attached Excel workbook file contains the VBA, but the same code should work for any Office product.

    Example output :

Product Id : Microsoft Office Professional Plus 2010
Release Type : Volume license
Release Version : RTM. This is the first shipped version (the initial release).
Major Version : 14
Minor Version : 0
Build : 6024
32-bit

Get Microsoft Office Product Information using VBA
Get Microsoft Office Product Information using VBA