Command Bar Question

  • Thread starter Thread starter Jack Gillis
  • Start date Start date
J

Jack Gillis

I have a Workbook with a macro that displays a custom command bar. When
I use the Workbook on a machine that doesn't have my custom Excel.xlb
file on it of course the macro fails.

Is there anyway I can change the macro so that it will sense if the
custom command bar exist or not? Some sort of Case or IF Then
statement, I guess. The old batch file command 'if exists' come to
mind.

Thank you very much.
 
THANK YOU, DAVE. (And yes I know I am shouting.)

I chose your toolbar example rather than then menumaker solution because
it suited my purposes better. I modified your code slightly and it does
what I want it to do and when I wanted it done. Am one happy camper
now.

Three questions remain at this point, however.

1. Is there a way I can add color to the background of the created
toolbar or to the font of the caption?
2. Is it possible to add a custom icon the caption?
3. Where are the mso thingys documented? I can see a future use for
this information.

Again, thank you for pointing me in the right direction.
 
I set this up to run several macros in order.

This line:
..FaceId = 71 + i
does put custom icons near those buttons.

But the custom icons look like numbers--it was easier to say: Click #1, then
#2, ...

You can create your own custom icons--or even use the icons that are built into
excel.

John Walkenbach has a FaceId identifier program at:
http://j-walk.com/ss/excel/tips/tip67.htm

Jim Rech has one at:
http://www.oaltd.co.uk/MVP/MVPPage.asp#JimRech

You could even use your own pictures. If you put them on a worksheet, you can
paste them into the face.

I searched google within the *excel* newsgroups for "pasteface"

and found a bunch of posts. This was the first:
http://groups.google.co.uk/groups?threadm=eoFSAoq7BHA.2332@tkmsftngp03

===

I've never looked to change the font/background color, but I didn't see anything
that I could use when I just looked. (Maybe someone else can jump in if they
know a way.)

And VBA's help and object browser are one way to learn more.

You could get a book, too. Debra Dalgleish has a nice list of books at:
http://www.contextures.com/xlbooks.html

John Walkenbach's is a nice one to start with. I think that John Green (and
others) is nice, too (for a second book??). See if you can find them in your
local bookstore and you can choose what one you like best.
 
And once you find the faceids you want to use (I'm guessing you'll find the ones
you want using John or Jim's utility).

Add an extra declare:
Dim myFaceIds as variant

Put the faceids in order:
myFaceIds = Array(12, _
14, _
22)

Then use those id's:
.FaceId = myFaceIds(i)





<<snipped>>
 
Thanks again, Dave.

I off a'huntin the faceID's

Dave Peterson said:
And once you find the faceids you want to use (I'm guessing you'll
find the ones
you want using John or Jim's utility).

Add an extra declare:
Dim myFaceIds as variant

Put the faceids in order:
myFaceIds = Array(12, _
14, _
22)

Then use those id's:
.FaceId = myFaceIds(i)






<<snipped>>
 
Back
Top