ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Opening the VB Editor via VB (https://www.excelbanter.com/excel-programming/418722-opening-vbulletin-editor-via-vbulletin.html)

rivers

Opening the VB Editor via VB
 
Guys ive created a custom toolbar and to save time doing it again at work ive
created my toolbar using VB macro. simple enough! however theres a few
options i cant find how to code.

the first is the vb editor. i know i can press alt f11 or simply add the
command via the customiser but how do i call it via vb?

the second is the macro box where you select the macro you require from the
list box.

can anyone help?

Rivers

JLGWhiz

Opening the VB Editor via VB
 
Application.VBE.MainWindow.Visible = True

Application.Dialogs(xlDialogMacroOptions).Show

"Rivers" wrote:

Guys ive created a custom toolbar and to save time doing it again at work ive
created my toolbar using VB macro. simple enough! however theres a few
options i cant find how to code.

the first is the vb editor. i know i can press alt f11 or simply add the
command via the customiser but how do i call it via vb?

the second is the macro box where you select the macro you require from the
list box.

can anyone help?

Rivers


rivers

Opening the VB Editor via VB
 
hi thanks for the quick response but they do not work

the
Application.VBE.MainWindow.Visible = True

gives a warning of it cannot be trusted

end the
Application.Dialogs(xlDialogMacroOptions).Show

and this gives a warning of dialogue class failed

am i entering these in incorrectly

thanks again
rivers

"JLGWhiz" wrote:

Application.VBE.MainWindow.Visible = True

Application.Dialogs(xlDialogMacroOptions).Show

"Rivers" wrote:

Guys ive created a custom toolbar and to save time doing it again at work ive
created my toolbar using VB macro. simple enough! however theres a few
options i cant find how to code.

the first is the vb editor. i know i can press alt f11 or simply add the
command via the customiser but how do i call it via vb?

the second is the macro box where you select the macro you require from the
list box.

can anyone help?

Rivers


JLGWhiz

Opening the VB Editor via VB
 
If your security setting is at medium you might get the message that it can't
be trusted, but it came right out of the VBA help file, so it is probably
just following the security protocol to warn you.

I cannot find any info on the MacroOptions dialog box, but it also is in the
VBA help files and should work unless Microsoft disabled it for some reason.
I could not get it to work either and like I said, nothing in the knowledge
base about it under that name. There is a MacroOptions method, but I don't
believe that would help you. You might look into using send keys to open the
dialog box for macros.

"Rivers" wrote:

hi thanks for the quick response but they do not work

the
Application.VBE.MainWindow.Visible = True

gives a warning of it cannot be trusted

end the
Application.Dialogs(xlDialogMacroOptions).Show

and this gives a warning of dialogue class failed

am i entering these in incorrectly

thanks again
rivers

"JLGWhiz" wrote:

Application.VBE.MainWindow.Visible = True

Application.Dialogs(xlDialogMacroOptions).Show

"Rivers" wrote:

Guys ive created a custom toolbar and to save time doing it again at work ive
created my toolbar using VB macro. simple enough! however theres a few
options i cant find how to code.

the first is the vb editor. i know i can press alt f11 or simply add the
command via the customiser but how do i call it via vb?

the second is the macro box where you select the macro you require from the
list box.

can anyone help?

Rivers


ShaneDevenshire

Opening the VB Editor via VB
 
Hi,

I believe the Application.Dialogs(xlDialogMacroOptions).Show
command has a number of arguments that are needed because this isn't the
Macros dialog box but the Options dialog box that displays when you click the
Optins button when you are in the Macros dialog box.

--
Thanks,
Shane Devenshire


"JLGWhiz" wrote:

If your security setting is at medium you might get the message that it can't
be trusted, but it came right out of the VBA help file, so it is probably
just following the security protocol to warn you.

I cannot find any info on the MacroOptions dialog box, but it also is in the
VBA help files and should work unless Microsoft disabled it for some reason.
I could not get it to work either and like I said, nothing in the knowledge
base about it under that name. There is a MacroOptions method, but I don't
believe that would help you. You might look into using send keys to open the
dialog box for macros.

"Rivers" wrote:

hi thanks for the quick response but they do not work

the
Application.VBE.MainWindow.Visible = True

gives a warning of it cannot be trusted

end the
Application.Dialogs(xlDialogMacroOptions).Show

and this gives a warning of dialogue class failed

am i entering these in incorrectly

thanks again
rivers

"JLGWhiz" wrote:

Application.VBE.MainWindow.Visible = True

Application.Dialogs(xlDialogMacroOptions).Show

"Rivers" wrote:

Guys ive created a custom toolbar and to save time doing it again at work ive
created my toolbar using VB macro. simple enough! however theres a few
options i cant find how to code.

the first is the vb editor. i know i can press alt f11 or simply add the
command via the customiser but how do i call it via vb?

the second is the macro box where you select the macro you require from the
list box.

can anyone help?

Rivers


JLGWhiz

Opening the VB Editor via VB
 
I think my other message got lost in cyberspace. You are right, Shane.
After a lot of reading and research I had come to that conclusion. It is one
of the methods that I have never used and I was guessing at what it did. I
also found that the SendKeys:

Application.SendKeys "%{F8}"

Does not work either. It simply activates the menu bar, although manually
Alt + F8 will open the dialog box for macros. Send Keys is another one that
I rarely use, so I could be screwing it up. I don't know if it requires
Shell every time it runs or not.
I try to stay away from all those frilly things when I plan a project and
just use good ole VBA code syntax and methods.

"ShaneDevenshire" wrote:

Hi,

I believe the Application.Dialogs(xlDialogMacroOptions).Show
command has a number of arguments that are needed because this isn't the
Macros dialog box but the Options dialog box that displays when you click the
Optins button when you are in the Macros dialog box.

--
Thanks,
Shane Devenshire


"JLGWhiz" wrote:

If your security setting is at medium you might get the message that it can't
be trusted, but it came right out of the VBA help file, so it is probably
just following the security protocol to warn you.

I cannot find any info on the MacroOptions dialog box, but it also is in the
VBA help files and should work unless Microsoft disabled it for some reason.
I could not get it to work either and like I said, nothing in the knowledge
base about it under that name. There is a MacroOptions method, but I don't
believe that would help you. You might look into using send keys to open the
dialog box for macros.

"Rivers" wrote:

hi thanks for the quick response but they do not work

the
Application.VBE.MainWindow.Visible = True
gives a warning of it cannot be trusted

end the
Application.Dialogs(xlDialogMacroOptions).Show
and this gives a warning of dialogue class failed

am i entering these in incorrectly

thanks again
rivers

"JLGWhiz" wrote:

Application.VBE.MainWindow.Visible = True

Application.Dialogs(xlDialogMacroOptions).Show

"Rivers" wrote:

Guys ive created a custom toolbar and to save time doing it again at work ive
created my toolbar using VB macro. simple enough! however theres a few
options i cant find how to code.

the first is the vb editor. i know i can press alt f11 or simply add the
command via the customiser but how do i call it via vb?

the second is the macro box where you select the macro you require from the
list box.

can anyone help?

Rivers



All times are GMT +1. The time now is 12:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com