2007 support for legacy CommandBars

N

Nick Hertl

I am working with two Office 2000 templates that have been deployed in the
"C:\Program Files\Microsoft Office\Office12\STARTUP" directory for Word, and
"C:\Program Files\Microsoft Office\Office12\XLSTART" for Excel. These
documents have VBA code and CommandBars that cause each opened document to
get the cool behavior.

If you deploy this on Office 2007, I see different behavior between Word and
Excel.

On Word, removing the file from STARTUP, and closing and re-opening Word,
causes the Add-In stuff to go away. This is great.

On Excel, removing the file from XLSTART does not remove the Add-In tab
stuff from the Ribbon.

What is Excel doing behind the scenes to put this CommandBar in place and
how can I remove it from the Add-Ins tab once it's put it in there for me.

Thanks in advance for any help.

--Nick
 
P

Patrick Schmid [MVP]

You can right-click the commandbars toolbar in the add-ins tab and
remove it with the right-click menu.

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
Office 2007 Beta 2 Technical Refresh (B2TR):
http://pschmid.net/blog/2006/09/18/43
***
Customize Office 2007: http://pschmid.net/office2007/customize
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed
 
N

Nick Hertl

I have just tried your suggestion without success.

Right Clicking the CommandBar provides me with only two options:

1) Customizethe QAT
2) Place QAT below the Ribbon

Neither of these are what I want to do.

The real question is, how does Excel decide that this CommandBar even
belongs on the Ribbon? I removed the xls file from the XLSTART directory.
What is left to remove?

--Nick

Patrick Schmid said:
You can right-click the commandbars toolbar in the add-ins tab and
remove it with the right-click menu.

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
Office 2007 Beta 2 Technical Refresh (B2TR):
http://pschmid.net/blog/2006/09/18/43
***
Customize Office 2007: http://pschmid.net/office2007/customize
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed

I am working with two Office 2000 templates that have been deployed in the
"C:\Program Files\Microsoft Office\Office12\STARTUP" directory for Word, and
"C:\Program Files\Microsoft Office\Office12\XLSTART" for Excel. These
documents have VBA code and CommandBars that cause each opened document to
get the cool behavior.

If you deploy this on Office 2007, I see different behavior between Word and
Excel.

On Word, removing the file from STARTUP, and closing and re-opening Word,
causes the Add-In stuff to go away. This is great.

On Excel, removing the file from XLSTART does not remove the Add-In tab
stuff from the Ribbon.

What is Excel doing behind the scenes to put this CommandBar in place and
how can I remove it from the Add-Ins tab once it's put it in there for me.

Thanks in advance for any help.

--Nick
 
P

Patrick Schmid [MVP]

The problem with the old CommandBars was that the developer had to
remove them manually themselves. So if you didn't write the code that
would remove the CommandBar, it just stuck there in Office until the
user did something about it.
I think you clicked the wrong thing. See
http://pschmid.net/blog/2006/10/18/68, the "legacy menus and toolbars"
section. You want to right-click on one of the icons in your CommandBar.

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
Office 2007 Beta 2 Technical Refresh (B2TR):
http://pschmid.net/blog/2006/09/18/43
***
Customize Office 2007: http://pschmid.net/office2007/customize
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed

I have just tried your suggestion without success.

Right Clicking the CommandBar provides me with only two options:

1) Customizethe QAT
2) Place QAT below the Ribbon

Neither of these are what I want to do.

The real question is, how does Excel decide that this CommandBar even
belongs on the Ribbon? I removed the xls file from the XLSTART directory.
What is left to remove?

--Nick

Patrick Schmid said:
You can right-click the commandbars toolbar in the add-ins tab and
remove it with the right-click menu.

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
Office 2007 Beta 2 Technical Refresh (B2TR):
http://pschmid.net/blog/2006/09/18/43
***
Customize Office 2007: http://pschmid.net/office2007/customize
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed

I am working with two Office 2000 templates that have been deployed in the
"C:\Program Files\Microsoft Office\Office12\STARTUP" directory for Word, and
"C:\Program Files\Microsoft Office\Office12\XLSTART" for Excel. These
documents have VBA code and CommandBars that cause each opened document to
get the cool behavior.

If you deploy this on Office 2007, I see different behavior between Word and
Excel.

On Word, removing the file from STARTUP, and closing and re-opening Word,
causes the Add-In stuff to go away. This is great.

On Excel, removing the file from XLSTART does not remove the Add-In tab
stuff from the Ribbon.

What is Excel doing behind the scenes to put this CommandBar in place and
how can I remove it from the Add-Ins tab once it's put it in there for me.

Thanks in advance for any help.

--Nick
 
X

XL-Dennis

Nick,

In general it's advisable to always 'clean up' by deleting any customized
toolbar etc.

I suspect that there might be an old customized toolbar left and therefore
nothing happens when You remove the file from the XLSTART folder.

You should add to the procedure which create Your toolbar in the first line
the following snippet code:
On Error Resume Next
Application.CommandBars("NameToolbar").Delete
On Error GoTo 0

When You create the Toolbar You should use the parameter 'Temporary' in the
add toolbar method:
Application.CommandBars.Add(Name:="Test", Temporary:=True)

I've never experienced (so far!) any issues with the above suggested
approaches.

---------------
With kind regards,
Dennis
Weekly Blog .NET & Excel: http://xldennis.wordpress.com/
My English site: http://www.excelkb.com/default.aspx
My Swedish site: http://www.xldennis.com/
 
N

Nick Hertl

Thanks Dennis, that's exactly what I was looking for. I'll just put that
code into the OnConnection function so that the old one is removed if it's
still there.

The reason I couldn't manually remove it as Patrick suggested is because I
had tried using the original Beta 2 which aparently didn't have that feature
yet.

Thanks,
--Nick
 
X

XL-Dennis

Nick,

Thanks for the feedback and I'm glad that You worked it out.

If You develop COM Add-ins then I also suggest that You add the same code to
the
OnDisconnection event as well. It may seem to be an 'overkilling' approach
but during the years I've learned to really 'clean up' my add-ins.

---------------
With kind regards,
Dennis
Weekly Blog .NET & Excel: http://xldennis.wordpress.com/
My English site: http://www.excelkb.com/default.aspx
My Swedish site: http://www.xldennis.com/
 

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