stop app from running on workbook open

d0wnt0wn

Well-known Member
Joined
Oct 28, 2002
Messages
771
hi i was wondering if someone could look at this code for me and tell me how to stop the calculator app from running on open...



Private Sub Workbook_Open()
Dim Ctl As CommandBarControl
Dim MenuItem As CommandBarControl
On Error Resume Next
Set Ctl = Application.CommandBars(1).FindControl(ID:=30007)
If Ctl Is Nothing Then
MsgBox "Cannot add a menu item to the Tools menu.", vbCritical, APPNAME
Else
Ctl.Controls(APPNAME).Delete
On Error GoTo 0
Set MenuItem = Ctl.Controls.Add
With MenuItem
.caption = APPNAME
.OnAction = "ShowCalculatorToolbar"
End With
End If
On Error GoTo 0
ShowCalculatorToolbar
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim Ctl As CommandBarControl
Dim MenuItem As CommandBarControl
On Error Resume Next
Set Ctl = Application.CommandBars(1).FindControl(ID:=30007)
Ctl.Controls(APPNAME).Delete
On Error GoTo 0
End Sub
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,214,889
Messages
6,122,097
Members
449,065
Latest member
albertocarrillom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top