1VERSION 5.00 2Begin {AC0714F6-3D04-11D1-AE7D-00A0C90F26F4} Wizard 3 ClientHeight = 7470 4 ClientLeft = 1740 5 ClientTop = 1545 6 ClientWidth = 6585 7 _ExtentX = 11615 8 _ExtentY = 13176 9 _Version = 393216 10 DisplayName = "AnalysisWizard" 11 AppName = "Visual Basic" 12 AppVer = "Visual Basic 6.0" 13 LoadName = "Command Line / Startup" 14 LoadBehavior = 5 15 RegLocation = "HKEY_CURRENT_USER\Software\Microsoft\Visual Basic\6.0" 16 CmdLineSupport = -1 'True 17End 18Attribute VB_Name = "Wizard" 19Attribute VB_GlobalNameSpace = False 20Attribute VB_Creatable = True 21Attribute VB_PredeclaredId = False 22Attribute VB_Exposed = False 23Option Explicit 24 25Dim mcbMenuCommandBar As Office.CommandBarControl 'command bar object 26Public WithEvents MenuHandler As CommandBarEvents 'command bar event handler 27Attribute MenuHandler.VB_VarHelpID = -1 28Dim mfrmWizard As frmWizard 29Dim VBInstance As VBIDE.VBE 30 31 32'------------------------------------------------------ 33'this method adds the Add-In to the VB menu 34'it is called by the VB addin manager 35'------------------------------------------------------ 36Private Sub AddinInstance_OnConnection(ByVal application As Object, ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, ByVal AddInInst As Object, custom() As Variant) 37 On Error GoTo error_handler 38 39 Set VBInstance = application 40 41 If ConnectMode = ext_cm_External Then 42 'Used by the wizard toolbar to start this wizard 43 LoadMe 44 Else 45 Set mcbMenuCommandBar = AddToAddInCommandBar(VBInstance, LoadResString(15), LoadResPicture(5000, 0)) 46 'sink the event 47 Set Me.MenuHandler = VBInstance.Events.CommandBarEvents(mcbMenuCommandBar) 48 End If 49 50 Exit Sub 51 52error_handler: 53 MsgBox Err.Description 54End Sub 55 56'------------------------------------------------------ 57'this method removes the Add-In from the VB menu 58'it is called by the VB addin manager 59'------------------------------------------------------ 60Private Sub AddinInstance_OnDisconnection(ByVal RemoveMode As AddInDesignerObjects.ext_DisconnectMode, custom() As Variant) 61 'delete the command bar entry 62 mcbMenuCommandBar.Delete 63End Sub 64 65'this event fires when the menu is clicked in the IDE 66Private Sub MenuHandler_Click(ByVal CommandBarControl As Object, handled As Boolean, CancelDefault As Boolean) 67 LoadMe 68End Sub 69 70Private Sub LoadMe() 71 Set mfrmWizard = New frmWizard 72 'pass the vb instance to the wizard module 73 Set mfrmWizard.VBInst = VBInstance 74 'load and show the form 75 mfrmWizard.Show vbModal 76 Set mfrmWizard = Nothing 77End Sub 78 79 80