CommandBar ActiveX

R

Rob van Gelder

Hi Everyone.

I read the other day about the Object Browser and how you can Show Hidden
Members.
So, I thought I'd go exploring - for fun - and discovered CommandBarActiveX
object.

I got it sort of working so you can have a WebBrowser Commandbar Button -
which is promising.
For my own personal productivity Personal.xls, I'd like to build it more.
It gets funky with the Width and Height - making it's own mind up -
especially when docking.

Has anyone has experience in this area and can assist?


Private MyWeb As WebBrowser

Sub test()
Const cBarName = "My Web Browser"
Dim bar As CommandBar, cbt As [_CommandBarActiveX]

On Error Resume Next: Application.CommandBars(cBarName).Delete: On Error
GoTo 0

With Application.CommandBars.Add(cBarName, , , True)
Set cbt = .Controls.Add(msoControlActiveX)
cbt.ControlCLSID = "{8856F961-340A-11D0-A96B-00C04FD705A2}"
'Microsoft Internet Controls
.Visible = True
DoEvents
Set MyWeb =
cbt.QueryControlInterface("{00020400-0000-0000-C000-000000000046}")
'IDispatch
MyWeb.Navigate2 "http://www.google.com/"
End With
End Sub


(Please, no reminders about the nature of undocumented features...)

Cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top