Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 265
Default How to save a menu bar

Hi, I made a menu bar, I want to save my customized menu bar in a disk an
copy to another computer, how???

The menu could be copied when I copy a file???
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default How to save a menu bar

This is best accomplished with an Addin... In the addin include coee simlar
to this in ThisWorkbook

Private Sub Workbook_AddinInstall()
AddMyMenu
End Sub

Private Sub Workbook_AddinUninstall()
DeleteMyMenu

End Sub

I know that your code has been improving by leaps and bounds so I will not
go into the whole addin thing unless you want help... Best of Luck

HTH

"filo666" wrote:

Hi, I made a menu bar, I want to save my customized menu bar in a disk an
copy to another computer, how???

The menu could be copied when I copy a file???

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default How to save a menu bar

Sorry Jim, gotta disagree with ya there.

I would NOT use AddinInstall/Uninstall, but rather use the
Workbook_Open/BeforeClose events. There is a huge difference between them.
The Install/Uninstall will only fire when you goto Tools | Addins, select
add-in and press Ok. The Open/BeforeClose procedures will fire everytime
you open/close Excel.

If you're looking for functionality that won't happen just on the initial
installation, use the Open/BeforeClose events of the add-ins workbook
module.

--
Regards,
Zack Barresse, aka firefytr


"Jim Thomlinson" wrote in message
...
This is best accomplished with an Addin... In the addin include coee
simlar
to this in ThisWorkbook

Private Sub Workbook_AddinInstall()
AddMyMenu
End Sub

Private Sub Workbook_AddinUninstall()
DeleteMyMenu

End Sub

I know that your code has been improving by leaps and bounds so I will not
go into the whole addin thing unless you want help... Best of Luck

HTH

"filo666" wrote:

Hi, I made a menu bar, I want to save my customized menu bar in a disk an
copy to another computer, how???

The menu could be copied when I copy a file???



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default How to save a menu bar

Interesting... I don't agree but interesting... What functionallity for a
menu bar requires initializing on open or on close? I am hard pressed to come
up with one. (at least for a generic set of utility type functions). However
the before close event fires before Excel closes. If you hit cancel then you
have already lost the menu bar but Excel is still open. This is kind of
annoying. Please fire back a response. I would love to know your reasoning...
:-)

"zackb" wrote:

Sorry Jim, gotta disagree with ya there.

I would NOT use AddinInstall/Uninstall, but rather use the
Workbook_Open/BeforeClose events. There is a huge difference between them.
The Install/Uninstall will only fire when you goto Tools | Addins, select
add-in and press Ok. The Open/BeforeClose procedures will fire everytime
you open/close Excel.

If you're looking for functionality that won't happen just on the initial
installation, use the Open/BeforeClose events of the add-ins workbook
module.

--
Regards,
Zack Barresse, aka firefytr


"Jim Thomlinson" wrote in message
...
This is best accomplished with an Addin... In the addin include coee
simlar
to this in ThisWorkbook

Private Sub Workbook_AddinInstall()
AddMyMenu
End Sub

Private Sub Workbook_AddinUninstall()
DeleteMyMenu

End Sub

I know that your code has been improving by leaps and bounds so I will not
go into the whole addin thing unless you want help... Best of Luck

HTH

"filo666" wrote:

Hi, I made a menu bar, I want to save my customized menu bar in a disk an
copy to another computer, how???

The menu could be copied when I copy a file???




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 265
Default How to save a menu bar

tks, this was very helpfull

"Jim Thomlinson" wrote:

This is best accomplished with an Addin... In the addin include coee simlar
to this in ThisWorkbook

Private Sub Workbook_AddinInstall()
AddMyMenu
End Sub

Private Sub Workbook_AddinUninstall()
DeleteMyMenu

End Sub

I know that your code has been improving by leaps and bounds so I will not
go into the whole addin thing unless you want help... Best of Luck

HTH

"filo666" wrote:

Hi, I made a menu bar, I want to save my customized menu bar in a disk an
copy to another computer, how???

The menu could be copied when I copy a file???



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default How to save a menu bar

Create an add-in. Do as you say and create the toolbar on AddinInstall,
then delete it on AddinUninstall. Then install the add-in, then close Excel
and reopen it. Does your toolbar reinstall itself? This is not the true
purpose of an add-in, imho. True, you get add-ins to close and will stay
gone if you press Cancel, but it's better than not having it at all.

Compare these two sets of codes ...

'Private Sub Workbook_AddinInstall()
' CreateMenu
'End Sub
'Private Sub Workbook_AddinUninstall()
' DeleteMenu
'End Sub
''--------------------------------------------------
'Private Sub Workbook_BeforeClose(Cancel As Boolean)
' DeleteMenu
'End Sub
'Private Sub Workbook_Open()
' CreateMenu
'End Sub

Uncomment them individually and run tests on them both.

Unless I missed something (which is highly possible :p ).

--
Regards,
Zack Barresse, aka firefytr

"Jim Thomlinson" wrote in message
...
Interesting... I don't agree but interesting... What functionallity for a
menu bar requires initializing on open or on close? I am hard pressed to
come
up with one. (at least for a generic set of utility type functions).
However
the before close event fires before Excel closes. If you hit cancel then
you
have already lost the menu bar but Excel is still open. This is kind of
annoying. Please fire back a response. I would love to know your
reasoning...
:-)

"zackb" wrote:

Sorry Jim, gotta disagree with ya there.

I would NOT use AddinInstall/Uninstall, but rather use the
Workbook_Open/BeforeClose events. There is a huge difference between
them.
The Install/Uninstall will only fire when you goto Tools | Addins, select
add-in and press Ok. The Open/BeforeClose procedures will fire everytime
you open/close Excel.

If you're looking for functionality that won't happen just on the initial
installation, use the Open/BeforeClose events of the add-ins workbook
module.

--
Regards,
Zack Barresse, aka firefytr


"Jim Thomlinson" wrote in
message
...
This is best accomplished with an Addin... In the addin include coee
simlar
to this in ThisWorkbook

Private Sub Workbook_AddinInstall()
AddMyMenu
End Sub

Private Sub Workbook_AddinUninstall()
DeleteMyMenu

End Sub

I know that your code has been improving by leaps and bounds so I will
not
go into the whole addin thing unless you want help... Best of Luck

HTH

"filo666" wrote:

Hi, I made a menu bar, I want to save my customized menu bar in a disk
an
copy to another computer, how???

The menu could be copied when I copy a file???






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default How to save a menu bar

... btw, earlier posted code, where CreateMenu and DeleteMenu are seperate
procedures in a Standard Module that do as they imply. Sorry, forgot to
mention that. :(

--
Regards,
Zack Barresse, aka firefytr

"Jim Thomlinson" wrote in message
...
Interesting... I don't agree but interesting... What functionallity for a
menu bar requires initializing on open or on close? I am hard pressed to
come
up with one. (at least for a generic set of utility type functions).
However
the before close event fires before Excel closes. If you hit cancel then
you
have already lost the menu bar but Excel is still open. This is kind of
annoying. Please fire back a response. I would love to know your
reasoning...
:-)

"zackb" wrote:

Sorry Jim, gotta disagree with ya there.

I would NOT use AddinInstall/Uninstall, but rather use the
Workbook_Open/BeforeClose events. There is a huge difference between
them.
The Install/Uninstall will only fire when you goto Tools | Addins, select
add-in and press Ok. The Open/BeforeClose procedures will fire everytime
you open/close Excel.

If you're looking for functionality that won't happen just on the initial
installation, use the Open/BeforeClose events of the add-ins workbook
module.

--
Regards,
Zack Barresse, aka firefytr


"Jim Thomlinson" wrote in
message
...
This is best accomplished with an Addin... In the addin include coee
simlar
to this in ThisWorkbook

Private Sub Workbook_AddinInstall()
AddMyMenu
End Sub

Private Sub Workbook_AddinUninstall()
DeleteMyMenu

End Sub

I know that your code has been improving by leaps and bounds so I will
not
go into the whole addin thing unless you want help... Best of Luck

HTH

"filo666" wrote:

Hi, I made a menu bar, I want to save my customized menu bar in a disk
an
copy to another computer, how???

The menu could be copied when I copy a file???






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default How to save a menu bar

I must be missing something. I am creating a menu bar. I have tried
installing, uninstalling and reinstalling the addin. I can not create a
situation where the menu does not get re-installed. The only thing that
changed by using your code was the uninstall before close and I lost my state
for the following line of code

ctlCBarControl.State = msoButtonDown

My state is always msoButtonUp when I restart Excel. I can send you my code
to see if I am doing anything terribly different from you...

If I run the code manually without using Tools - addins I can get rid of
the menu bar while the addin is still installed but by just toggling the
install off and on I can get the menu bar back. And to make this happen I
need to run the code in the VBE so since it is a protected addin the user
can't do that anyway.

Puzzling?

"zackb" wrote:

Create an add-in. Do as you say and create the toolbar on AddinInstall,
then delete it on AddinUninstall. Then install the add-in, then close Excel
and reopen it. Does your toolbar reinstall itself? This is not the true
purpose of an add-in, imho. True, you get add-ins to close and will stay
gone if you press Cancel, but it's better than not having it at all.

Compare these two sets of codes ...

'Private Sub Workbook_AddinInstall()
' CreateMenu
'End Sub
'Private Sub Workbook_AddinUninstall()
' DeleteMenu
'End Sub
''--------------------------------------------------
'Private Sub Workbook_BeforeClose(Cancel As Boolean)
' DeleteMenu
'End Sub
'Private Sub Workbook_Open()
' CreateMenu
'End Sub

Uncomment them individually and run tests on them both.

Unless I missed something (which is highly possible :p ).

--
Regards,
Zack Barresse, aka firefytr

"Jim Thomlinson" wrote in message
...
Interesting... I don't agree but interesting... What functionallity for a
menu bar requires initializing on open or on close? I am hard pressed to
come
up with one. (at least for a generic set of utility type functions).
However
the before close event fires before Excel closes. If you hit cancel then
you
have already lost the menu bar but Excel is still open. This is kind of
annoying. Please fire back a response. I would love to know your
reasoning...
:-)

"zackb" wrote:

Sorry Jim, gotta disagree with ya there.

I would NOT use AddinInstall/Uninstall, but rather use the
Workbook_Open/BeforeClose events. There is a huge difference between
them.
The Install/Uninstall will only fire when you goto Tools | Addins, select
add-in and press Ok. The Open/BeforeClose procedures will fire everytime
you open/close Excel.

If you're looking for functionality that won't happen just on the initial
installation, use the Open/BeforeClose events of the add-ins workbook
module.

--
Regards,
Zack Barresse, aka firefytr


"Jim Thomlinson" wrote in
message
...
This is best accomplished with an Addin... In the addin include coee
simlar
to this in ThisWorkbook

Private Sub Workbook_AddinInstall()
AddMyMenu
End Sub

Private Sub Workbook_AddinUninstall()
DeleteMyMenu

End Sub

I know that your code has been improving by leaps and bounds so I will
not
go into the whole addin thing unless you want help... Best of Luck

HTH

"filo666" wrote:

Hi, I made a menu bar, I want to save my customized menu bar in a disk
an
copy to another computer, how???

The menu could be copied when I copy a file???






  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default How to save a menu bar

Slightly puzzing. Maybe it's in our routines where the difference lies. I
still have the same results. Do you have any Class Modules running code?
Can you either post your routine or email me a sample workbook? If email,
addy is "firefytr at vbaexpress dot com".

--
Regards,
Zack Barresse, aka firefytr

"Jim Thomlinson" wrote in message
...
I must be missing something. I am creating a menu bar. I have tried
installing, uninstalling and reinstalling the addin. I can not create a
situation where the menu does not get re-installed. The only thing that
changed by using your code was the uninstall before close and I lost my
state
for the following line of code

ctlCBarControl.State = msoButtonDown

My state is always msoButtonUp when I restart Excel. I can send you my
code
to see if I am doing anything terribly different from you...

If I run the code manually without using Tools - addins I can get rid of
the menu bar while the addin is still installed but by just toggling the
install off and on I can get the menu bar back. And to make this happen I
need to run the code in the VBE so since it is a protected addin the user
can't do that anyway.

Puzzling?

"zackb" wrote:

Create an add-in. Do as you say and create the toolbar on AddinInstall,
then delete it on AddinUninstall. Then install the add-in, then close
Excel
and reopen it. Does your toolbar reinstall itself? This is not the true
purpose of an add-in, imho. True, you get add-ins to close and will stay
gone if you press Cancel, but it's better than not having it at all.

Compare these two sets of codes ...

'Private Sub Workbook_AddinInstall()
' CreateMenu
'End Sub
'Private Sub Workbook_AddinUninstall()
' DeleteMenu
'End Sub
''--------------------------------------------------
'Private Sub Workbook_BeforeClose(Cancel As Boolean)
' DeleteMenu
'End Sub
'Private Sub Workbook_Open()
' CreateMenu
'End Sub

Uncomment them individually and run tests on them both.

Unless I missed something (which is highly possible :p ).

--
Regards,
Zack Barresse, aka firefytr

"Jim Thomlinson" wrote in
message
...
Interesting... I don't agree but interesting... What functionallity for
a
menu bar requires initializing on open or on close? I am hard pressed
to
come
up with one. (at least for a generic set of utility type functions).
However
the before close event fires before Excel closes. If you hit cancel
then
you
have already lost the menu bar but Excel is still open. This is kind of
annoying. Please fire back a response. I would love to know your
reasoning...
:-)

"zackb" wrote:

Sorry Jim, gotta disagree with ya there.

I would NOT use AddinInstall/Uninstall, but rather use the
Workbook_Open/BeforeClose events. There is a huge difference between
them.
The Install/Uninstall will only fire when you goto Tools | Addins,
select
add-in and press Ok. The Open/BeforeClose procedures will fire
everytime
you open/close Excel.

If you're looking for functionality that won't happen just on the
initial
installation, use the Open/BeforeClose events of the add-ins workbook
module.

--
Regards,
Zack Barresse, aka firefytr


"Jim Thomlinson" wrote in
message
...
This is best accomplished with an Addin... In the addin include coee
simlar
to this in ThisWorkbook

Private Sub Workbook_AddinInstall()
AddMyMenu
End Sub

Private Sub Workbook_AddinUninstall()
DeleteMyMenu

End Sub

I know that your code has been improving by leaps and bounds so I
will
not
go into the whole addin thing unless you want help... Best of Luck

HTH

"filo666" wrote:

Hi, I made a menu bar, I want to save my customized menu bar in a
disk
an
copy to another computer, how???

The menu could be copied when I copy a file???








  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default How to save a menu bar

I'll send you the addin... It creates a menu bar with a bunch of handy
utilities...

"zackb" wrote:

Slightly puzzing. Maybe it's in our routines where the difference lies. I
still have the same results. Do you have any Class Modules running code?
Can you either post your routine or email me a sample workbook? If email,
addy is "firefytr at vbaexpress dot com".

--
Regards,
Zack Barresse, aka firefytr

"Jim Thomlinson" wrote in message
...
I must be missing something. I am creating a menu bar. I have tried
installing, uninstalling and reinstalling the addin. I can not create a
situation where the menu does not get re-installed. The only thing that
changed by using your code was the uninstall before close and I lost my
state
for the following line of code

ctlCBarControl.State = msoButtonDown

My state is always msoButtonUp when I restart Excel. I can send you my
code
to see if I am doing anything terribly different from you...

If I run the code manually without using Tools - addins I can get rid of
the menu bar while the addin is still installed but by just toggling the
install off and on I can get the menu bar back. And to make this happen I
need to run the code in the VBE so since it is a protected addin the user
can't do that anyway.

Puzzling?

"zackb" wrote:

Create an add-in. Do as you say and create the toolbar on AddinInstall,
then delete it on AddinUninstall. Then install the add-in, then close
Excel
and reopen it. Does your toolbar reinstall itself? This is not the true
purpose of an add-in, imho. True, you get add-ins to close and will stay
gone if you press Cancel, but it's better than not having it at all.

Compare these two sets of codes ...

'Private Sub Workbook_AddinInstall()
' CreateMenu
'End Sub
'Private Sub Workbook_AddinUninstall()
' DeleteMenu
'End Sub
''--------------------------------------------------
'Private Sub Workbook_BeforeClose(Cancel As Boolean)
' DeleteMenu
'End Sub
'Private Sub Workbook_Open()
' CreateMenu
'End Sub

Uncomment them individually and run tests on them both.

Unless I missed something (which is highly possible :p ).

--
Regards,
Zack Barresse, aka firefytr

"Jim Thomlinson" wrote in
message
...
Interesting... I don't agree but interesting... What functionallity for
a
menu bar requires initializing on open or on close? I am hard pressed
to
come
up with one. (at least for a generic set of utility type functions).
However
the before close event fires before Excel closes. If you hit cancel
then
you
have already lost the menu bar but Excel is still open. This is kind of
annoying. Please fire back a response. I would love to know your
reasoning...
:-)

"zackb" wrote:

Sorry Jim, gotta disagree with ya there.

I would NOT use AddinInstall/Uninstall, but rather use the
Workbook_Open/BeforeClose events. There is a huge difference between
them.
The Install/Uninstall will only fire when you goto Tools | Addins,
select
add-in and press Ok. The Open/BeforeClose procedures will fire
everytime
you open/close Excel.

If you're looking for functionality that won't happen just on the
initial
installation, use the Open/BeforeClose events of the add-ins workbook
module.

--
Regards,
Zack Barresse, aka firefytr


"Jim Thomlinson" wrote in
message
...
This is best accomplished with an Addin... In the addin include coee
simlar
to this in ThisWorkbook

Private Sub Workbook_AddinInstall()
AddMyMenu
End Sub

Private Sub Workbook_AddinUninstall()
DeleteMyMenu

End Sub

I know that your code has been improving by leaps and bounds so I
will
not
go into the whole addin thing unless you want help... Best of Luck

HTH

"filo666" wrote:

Hi, I made a menu bar, I want to save my customized menu bar in a
disk
an
copy to another computer, how???

The menu could be copied when I copy a file???











  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default How to save a menu bar

Jim,

First things first. Very nice add-in. :) Interesting coding style you
have there.

What I realized was that I was assuming a great many things, well, one in
particular. When I create add-ins I make them temporary. This behavior is
described by you, in that you exit the Excel Application and "Cancel out"
the add-in is removed (barring correct coding of routine deletion/removal)
but the App remains. Your add-in has the temporary status as False (as
opposed to mine being True). This means that in this same situation, your
add-in will not be removed. It also means that when the (Excel) Application
is loaded again after closure, the menu bar will already be there, even
though it shows being loading.

I don't know if I really see an advantage to having the add-in temporary
status set to False. But then again I can't say I really see a strong
advantage to having it set to True as well.

Anyway, needless to say in all my testing that was the last thing I would
have thought of and it had me going for a while too! And apparently there
is not a lot of difference between the Addin_Install/Uninstall and the
Workbook_Open/BeforeClose event; besides what you have pointed out, which
can be a pain to the user. So I'll have to say that I would go with the
Addin events rather than the Workbook events for the add-ins. (Guess
somebody with common sense is saying, "Doh!" about now..) I actually had to
step away from this test completely and have my friend look at MY add-in
(last place I was going to start looking) to tell me what I had
wrong/different in my testing scenario. It was a learning experience. So
for that, thank you very much!! :D

--
Regards,
Zack Barresse, aka firefytr

"Jim Thomlinson" wrote in message
...
I'll send you the addin... It creates a menu bar with a bunch of handy
utilities...

"zackb" wrote:

Slightly puzzing. Maybe it's in our routines where the difference lies.
I
still have the same results. Do you have any Class Modules running code?
Can you either post your routine or email me a sample workbook? If
email,
addy is "firefytr at vbaexpress dot com".

--
Regards,
Zack Barresse, aka firefytr

"Jim Thomlinson" wrote in
message
...
I must be missing something. I am creating a menu bar. I have tried
installing, uninstalling and reinstalling the addin. I can not create a
situation where the menu does not get re-installed. The only thing that
changed by using your code was the uninstall before close and I lost my
state
for the following line of code

ctlCBarControl.State = msoButtonDown

My state is always msoButtonUp when I restart Excel. I can send you my
code
to see if I am doing anything terribly different from you...

If I run the code manually without using Tools - addins I can get rid
of
the menu bar while the addin is still installed but by just toggling
the
install off and on I can get the menu bar back. And to make this happen
I
need to run the code in the VBE so since it is a protected addin the
user
can't do that anyway.

Puzzling?

"zackb" wrote:

Create an add-in. Do as you say and create the toolbar on
AddinInstall,
then delete it on AddinUninstall. Then install the add-in, then close
Excel
and reopen it. Does your toolbar reinstall itself? This is not the
true
purpose of an add-in, imho. True, you get add-ins to close and will
stay
gone if you press Cancel, but it's better than not having it at all.

Compare these two sets of codes ...

'Private Sub Workbook_AddinInstall()
' CreateMenu
'End Sub
'Private Sub Workbook_AddinUninstall()
' DeleteMenu
'End Sub
''--------------------------------------------------
'Private Sub Workbook_BeforeClose(Cancel As Boolean)
' DeleteMenu
'End Sub
'Private Sub Workbook_Open()
' CreateMenu
'End Sub

Uncomment them individually and run tests on them both.

Unless I missed something (which is highly possible :p ).

--
Regards,
Zack Barresse, aka firefytr

"Jim Thomlinson" wrote in
message
...
Interesting... I don't agree but interesting... What functionallity
for
a
menu bar requires initializing on open or on close? I am hard
pressed
to
come
up with one. (at least for a generic set of utility type functions).
However
the before close event fires before Excel closes. If you hit cancel
then
you
have already lost the menu bar but Excel is still open. This is kind
of
annoying. Please fire back a response. I would love to know your
reasoning...
:-)

"zackb" wrote:

Sorry Jim, gotta disagree with ya there.

I would NOT use AddinInstall/Uninstall, but rather use the
Workbook_Open/BeforeClose events. There is a huge difference
between
them.
The Install/Uninstall will only fire when you goto Tools | Addins,
select
add-in and press Ok. The Open/BeforeClose procedures will fire
everytime
you open/close Excel.

If you're looking for functionality that won't happen just on the
initial
installation, use the Open/BeforeClose events of the add-ins
workbook
module.

--
Regards,
Zack Barresse, aka firefytr


"Jim Thomlinson" wrote in
message
...
This is best accomplished with an Addin... In the addin include
coee
simlar
to this in ThisWorkbook

Private Sub Workbook_AddinInstall()
AddMyMenu
End Sub

Private Sub Workbook_AddinUninstall()
DeleteMyMenu

End Sub

I know that your code has been improving by leaps and bounds so I
will
not
go into the whole addin thing unless you want help... Best of
Luck

HTH

"filo666" wrote:

Hi, I made a menu bar, I want to save my customized menu bar in
a
disk
an
copy to another computer, how???

The menu could be copied when I copy a file???











  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default How to save a menu bar

Wow, second message. Had a very long response typed and it errored out
sending. Will copy to clipboard on large responses next time!

(Condensed version)
Nice utility Jim. Great coding.
Synopsis of testing: You were right. :)
Difference? My menubars Temporary status was set to True, not False.
Recommendation(s)? Use the Addin_Install/Uninstall event. :D
I learned a LOT of new things today. Thank you very much Jim!

--
Regards,
Zack Barresse, aka firefytr


"Jim Thomlinson" wrote in message
...
I'll send you the addin... It creates a menu bar with a bunch of handy
utilities...

"zackb" wrote:

Slightly puzzing. Maybe it's in our routines where the difference lies.
I
still have the same results. Do you have any Class Modules running code?
Can you either post your routine or email me a sample workbook? If
email,
addy is "firefytr at vbaexpress dot com".

--
Regards,
Zack Barresse, aka firefytr

"Jim Thomlinson" wrote in
message
...
I must be missing something. I am creating a menu bar. I have tried
installing, uninstalling and reinstalling the addin. I can not create a
situation where the menu does not get re-installed. The only thing that
changed by using your code was the uninstall before close and I lost my
state
for the following line of code

ctlCBarControl.State = msoButtonDown

My state is always msoButtonUp when I restart Excel. I can send you my
code
to see if I am doing anything terribly different from you...

If I run the code manually without using Tools - addins I can get rid
of
the menu bar while the addin is still installed but by just toggling
the
install off and on I can get the menu bar back. And to make this happen
I
need to run the code in the VBE so since it is a protected addin the
user
can't do that anyway.

Puzzling?

"zackb" wrote:

Create an add-in. Do as you say and create the toolbar on
AddinInstall,
then delete it on AddinUninstall. Then install the add-in, then close
Excel
and reopen it. Does your toolbar reinstall itself? This is not the
true
purpose of an add-in, imho. True, you get add-ins to close and will
stay
gone if you press Cancel, but it's better than not having it at all.

Compare these two sets of codes ...

'Private Sub Workbook_AddinInstall()
' CreateMenu
'End Sub
'Private Sub Workbook_AddinUninstall()
' DeleteMenu
'End Sub
''--------------------------------------------------
'Private Sub Workbook_BeforeClose(Cancel As Boolean)
' DeleteMenu
'End Sub
'Private Sub Workbook_Open()
' CreateMenu
'End Sub

Uncomment them individually and run tests on them both.

Unless I missed something (which is highly possible :p ).

--
Regards,
Zack Barresse, aka firefytr

"Jim Thomlinson" wrote in
message
...
Interesting... I don't agree but interesting... What functionallity
for
a
menu bar requires initializing on open or on close? I am hard
pressed
to
come
up with one. (at least for a generic set of utility type functions).
However
the before close event fires before Excel closes. If you hit cancel
then
you
have already lost the menu bar but Excel is still open. This is kind
of
annoying. Please fire back a response. I would love to know your
reasoning...
:-)

"zackb" wrote:

Sorry Jim, gotta disagree with ya there.

I would NOT use AddinInstall/Uninstall, but rather use the
Workbook_Open/BeforeClose events. There is a huge difference
between
them.
The Install/Uninstall will only fire when you goto Tools | Addins,
select
add-in and press Ok. The Open/BeforeClose procedures will fire
everytime
you open/close Excel.

If you're looking for functionality that won't happen just on the
initial
installation, use the Open/BeforeClose events of the add-ins
workbook
module.

--
Regards,
Zack Barresse, aka firefytr


"Jim Thomlinson" wrote in
message
...
This is best accomplished with an Addin... In the addin include
coee
simlar
to this in ThisWorkbook

Private Sub Workbook_AddinInstall()
AddMyMenu
End Sub

Private Sub Workbook_AddinUninstall()
DeleteMyMenu

End Sub

I know that your code has been improving by leaps and bounds so I
will
not
go into the whole addin thing unless you want help... Best of
Luck

HTH

"filo666" wrote:

Hi, I made a menu bar, I want to save my customized menu bar in
a
disk
an
copy to another computer, how???

The menu could be copied when I copy a file???











  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default How to save a menu bar

Okay, I'ma dork. ;)

"Zack Barresse" wrote in message
...
Wow, second message. Had a very long response typed and it errored out
sending. Will copy to clipboard on large responses next time!

(Condensed version)
Nice utility Jim. Great coding.
Synopsis of testing: You were right. :)
Difference? My menubars Temporary status was set to True, not False.
Recommendation(s)? Use the Addin_Install/Uninstall event. :D
I learned a LOT of new things today. Thank you very much Jim!

--
Regards,
Zack Barresse, aka firefytr


"Jim Thomlinson" wrote in
message
...
I'll send you the addin... It creates a menu bar with a bunch of handy
utilities...

"zackb" wrote:

Slightly puzzing. Maybe it's in our routines where the difference lies.
I
still have the same results. Do you have any Class Modules running
code?
Can you either post your routine or email me a sample workbook? If
email,
addy is "firefytr at vbaexpress dot com".

--
Regards,
Zack Barresse, aka firefytr

"Jim Thomlinson" wrote in
message
...
I must be missing something. I am creating a menu bar. I have tried
installing, uninstalling and reinstalling the addin. I can not create
a
situation where the menu does not get re-installed. The only thing
that
changed by using your code was the uninstall before close and I lost
my
state
for the following line of code

ctlCBarControl.State = msoButtonDown

My state is always msoButtonUp when I restart Excel. I can send you my
code
to see if I am doing anything terribly different from you...

If I run the code manually without using Tools - addins I can get rid
of
the menu bar while the addin is still installed but by just toggling
the
install off and on I can get the menu bar back. And to make this
happen
I
need to run the code in the VBE so since it is a protected addin the
user
can't do that anyway.

Puzzling?

"zackb" wrote:

Create an add-in. Do as you say and create the toolbar on
AddinInstall,
then delete it on AddinUninstall. Then install the add-in, then
close
Excel
and reopen it. Does your toolbar reinstall itself? This is not the
true
purpose of an add-in, imho. True, you get add-ins to close and will
stay
gone if you press Cancel, but it's better than not having it at all.

Compare these two sets of codes ...

'Private Sub Workbook_AddinInstall()
' CreateMenu
'End Sub
'Private Sub Workbook_AddinUninstall()
' DeleteMenu
'End Sub
''--------------------------------------------------
'Private Sub Workbook_BeforeClose(Cancel As Boolean)
' DeleteMenu
'End Sub
'Private Sub Workbook_Open()
' CreateMenu
'End Sub

Uncomment them individually and run tests on them both.

Unless I missed something (which is highly possible :p ).

--
Regards,
Zack Barresse, aka firefytr

"Jim Thomlinson" wrote in
message
...
Interesting... I don't agree but interesting... What functionallity
for
a
menu bar requires initializing on open or on close? I am hard
pressed
to
come
up with one. (at least for a generic set of utility type
functions).
However
the before close event fires before Excel closes. If you hit cancel
then
you
have already lost the menu bar but Excel is still open. This is
kind
of
annoying. Please fire back a response. I would love to know your
reasoning...
:-)

"zackb" wrote:

Sorry Jim, gotta disagree with ya there.

I would NOT use AddinInstall/Uninstall, but rather use the
Workbook_Open/BeforeClose events. There is a huge difference
between
them.
The Install/Uninstall will only fire when you goto Tools | Addins,
select
add-in and press Ok. The Open/BeforeClose procedures will fire
everytime
you open/close Excel.

If you're looking for functionality that won't happen just on the
initial
installation, use the Open/BeforeClose events of the add-ins
workbook
module.

--
Regards,
Zack Barresse, aka firefytr


"Jim Thomlinson" wrote
in
message
...
This is best accomplished with an Addin... In the addin include
coee
simlar
to this in ThisWorkbook

Private Sub Workbook_AddinInstall()
AddMyMenu
End Sub

Private Sub Workbook_AddinUninstall()
DeleteMyMenu

End Sub

I know that your code has been improving by leaps and bounds so
I
will
not
go into the whole addin thing unless you want help... Best of
Luck

HTH

"filo666" wrote:

Hi, I made a menu bar, I want to save my customized menu bar in
a
disk
an
copy to another computer, how???

The menu could be copied when I copy a file???













Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SAVE and SAVE AS options disappeared from the drop down FILE menu [email protected] Excel Discussion (Misc queries) 2 July 12th 07 09:14 AM
Menu bar won't save [email protected] Setting up and Configuration of Excel 8 October 8th 06 05:18 PM
SAVE AS menu option Mircea Pleteriu Excel Programming 3 March 10th 05 09:14 AM
Why can't I add Save As to my File menu? confuseduser Excel Discussion (Misc queries) 3 January 25th 05 11:31 PM
Save & Save As features in file menu of Excel Blue Excel Discussion (Misc queries) 9 December 27th 04 08:49 PM


All times are GMT +1. The time now is 02:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"