Toolbar problem

G

Guest

Can somebody please help me before I really hurt my head ageist a wall.

I have an Excel worksheet that contains a toolbar that I have created. When
I change or add anything to this toolbar and open the worksheet on another PC
in the office (from a shared drive) none of the changes or additions to my
toolbar are shown.

I have tried attaching and de-ataching the toolbar through right clicking
the toolbar and selecting customize. In fact here is the process that I
perform

Right click on the toolbar and delete my toolbar from the workbook
Amend the toolbar
Right click on the toolbar and add my toolbar back to the workbook
Save the workbook

Now, after completing the above process and I go to another office PC , none
of my changes are shown.

I also have this VB code to delete the toolbar on closing the workbook:-

Private Sub workbook_beforeclose(cancle As Boolean)
On Error Resume Next 'in case toolbar is absent
Application.CommandBars(LP_Log).Close

End Sub


Is this correct, because if I open a new excel worksheet my toolbar is shown !
If it is correct, where within my VB script should I place this code??

I hope somebody can offer some help, as this is really bugging the life out
of me.

I am in no way an expert in Excel VB so please explain in simple terms !!

Really appreciate any help

Cheers
 
D

Dave Peterson

Maybe your code should look more like this:

Option Explicit
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim LP_Log As String
LP_Log = "toolbarNameHere"
On Error Resume Next
Application.CommandBars(LP_Log).Delete
End Sub

It's difficult to tell what LP_log is.

You may want to read Jan Karel Pieterse's notes at:
http://google.com/[email protected]

In fact, Jan Karel wrote a different set of instructions that may help you avoid
the problems associated with attached toolbars.

http://www.jkp-ads.com/Articles/DistributeMacro00.htm
 

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