Workbook Open Event help

Hashiru

Active Member
Joined
May 29, 2011
Messages
286
Hi every one, I have just started scripting in vba, and I am faced with the problem of making the macro option dialog box more prominent than it is default in excel 2007. I have read that I cannot change the ribbon.
Instead what I want to do is to creat an event macro: workbook_open() and the code for it is to display the macro options dialog box to make it more prominent for others to notice that the workbook contain a macro. I have research the vba help with the excel dialog boxes and constants for these dialog box but the macro contain a bug and cannot run this line:

Application.Dialogs(xldialogMacroOptions).Show

From help I note that I need to specify some(an) argument for show but do not know how to do this. Can you show me how to completely do the event handler Private Sub Workbook_Open()
Thanks for your help in advance
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Sorry, you cannot programatically change the macro security settings (for obvious reasons).
 
Upvote 0
Can you please tell me why they allow the display of the dialog

Application.dialogs(xldialogOpen).show
Application.dialogs(xldialogSendMail).Show

but not

Application.dialogs(xldialogMacroOptions).show but they listed it as one on the excel dialog on the help system

Thanks
 
Upvote 0
You need to specify a macro name:

Code:
Application.Dialogs(xlDialogMacroOptions).Show "myMacro"
 
Upvote 0
To see the same dialog as when you press Alt+F8 (compliments of Andy Pope),

Code:
Application.CommandBars.FindControl(ID:=186).Execute
 
Upvote 0
That's a good intention. However, using code to show the dialog box is possible only *after* the consumer allows the macros to run in the first place!

And, of course, after s/he OKs macros there's no point is displaying the dialog box!
Hi every one, I have just started scripting in vba, and I am faced with the problem of making the macro option dialog box more prominent than it is default in excel 2007. I have read that I cannot change the ribbon.
Instead what I want to do is to creat an event macro: workbook_open() and the code for it is to display the macro options dialog box to make it more prominent for others to notice that the workbook contain a macro. I have research the vba help with the excel dialog boxes and constants for these dialog box but the macro contain a bug and cannot run this line:

Application.Dialogs(xldialogMacroOptions).Show

From help I note that I need to specify some(an) argument for show but do not know how to do this. Can you show me how to completely do the event handler Private Sub Workbook_Open()
Thanks for your help in advance
 
Upvote 0

Forum statistics

Threads
1,224,517
Messages
6,179,242
Members
452,898
Latest member
Capolavoro009

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