And that doesn't count the lines in the Ribbon XML I added when I ported this monster over to XL 2007 (which took a month).
Dictator applications take control of the entire Excel session, modifying the Excel user interface to make it appear and behave like an independent Windows application. By doing this, the dictator applications can leverage Ecel's rich feature set while maintaining a high dgreee of control over the actions that can be performed by the end user.
I'm going to steal from Professional Excel Developement by Bullen, Bovey, Green and Wallentin.
Imagine locking down each and every aspect of the user instraface with Excel, then exposing selected interfaces through your own front end. Re-write File-> Opne, and File->Save, as well as Copy, Paste, and everything in-between. It's very daunting, but when done carefully, it can actually SAVE you a bunch of work.
...but without the ability to customize/hijack the right-click menu anymore...
'// modify the cell (right-click) menu for matrix worksheets
'// to allow user to add start/stop times via the matrix
Set cbCellMenu = Application.CommandBars("Cell")
Set ctlNew = cbCellMenu.Controls.Add(Type:=Office.MsoControlType.msoControlButton)
With ctlNew
.Tag = gc_strCellMenuMtrxCtlTag1
.Caption = "Add/Edit E&xceptions..."
.OnAction = "AddEditExceptions"
End With
Set ctlNew = cbCellMenu.Controls.Add(Type:=Office.MsoControlType.msoControlButton)
With ctlNew
.Tag = gc_strCellMenuMtrxCtlTag2
.Caption = "Remo&ve Exceptions"
.OnAction = "RemoveExceptions"
End With
End If
On Error Resume Next
Application.CommandBars("Cell").FindControl(Tag:=gc_strCellMenuMtrxCtlTag1).Delete
Application.CommandBars("Cell").FindControl(Tag:=gc_strCellMenuMtrxCtlTag2).Delete
On Error GoTo m_appExcel_WorkbookDeactivate_Error