Create macro to load custom toolbar

  • Thread starter Jose Ruben Gonzalez-Baird
  • Start date
J

Jose Ruben Gonzalez-Baird

I want to create some kind of macro to load a custom toolbar that I've
created, so that when any other user opens the file from any other location
on our network, the toolbar will load. The custom toolbar is really just
using the Refresh data commands common to the External Data toolbar.

Is there a simple way of doing this that won't require extensive coding?
Would each user need to have an External Data add-in installed on their
machine? Would it be possible for the macro to check to see if the external
data add-in is installed, and if it wasn't, then install, and then load the
custom toolbar?

Thanks for any and all responses. J Ruben
 
J

Jose Ruben Gonzalez-Baird

I was looking for an "External Data" Add-in from the list of available
add-ins, and didn't see one. Does this mean that the external data commonds
are available to all Excel versions 2000 and higher? If so, this would
eliminate the need to load any kind of add-in upon file start-up. Thanks, J
Ruben
 
F

FSt1

hi.
there is one in 2000 and 2003.
Application.CommandBars("External Data").Visible = True
or use the name of your custom toolbar instead of external data.
You can put this in a workbook open module to load it each time.
then remove it in the before close event.
or just leave in visible all the time.

Regards
FSt1
 
G

Gord Dibben

Data>Import External Data.............see options for obtaining data.

After data has been downloaded...........Data>Refresh Data


Gord Dibben MS Excel MVP
 
J

Jose Ruben Gonzalez-Baird

Thanks for both of your responses. I ended up creating a macro that will
open when the particular file opens, and then turns the External Data toolbar
to Visible=True. See the following code:

Sub Auto_Open()
'
' OpenExternalDataToolbar Macro
' Macro recorded 12/27/2007 by J. Ruben Gonzalez-Baird
' Opens the External Data Toolbar so the user can refresh
' the external data linked to the Janus database
'
Application.CommandBars("External Data").Visible = True
End Sub

The "Auto_Open()" command runs the macro upon the application's open event.

This worked fine for me; I didn't have to write any code that would create a
custom toolbar using existing External Data commons (which would have been
ideal, but not absolutely necessary). The only hitch is that Secutiry level
has to be set to Medium or Low.

Thanks again, J Ruben.
 
F

FSt1

hi
glad we could help. and remember....recording a macro isn't that weird of
an idea. many time it can do what you want "as is" and many time it can show
you how code is constructed and the syntax (if you're on a learning curve).

regards
FSt1
 

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

Top