View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Doug Lowe Doug Lowe is offline
external usenet poster
 
Posts: 3
Default Toolbar question

I have an application I've written as a module in Personal.xls (Excel 2003)
that uses data in a large workbook to create a dozen or so smaller
workbooks. I want the smaller workbooks to include a toolbar that calls some
macros to filter the data in various ways. I want those macros to live in
the workbook itself, so that I can email the workbook to another worker who
can then run the macro.

To create the workbooks, the macro uses a line similar to Set wbNew =
Workbooks.Add("C:\Model.XLS"), and Model.XLS contains the macros as well as
the toolbar that links to the macros.

This seems to work fine, each workbook gets the macros and the toolbar.

But the problem is, when you open one of them, it copies the toolbar into
Personal.xls. Then, when you open a different one, it doesn't copy the
toolbar because one with that name already exists. So it uses the toolbar
from the other workbook, which calls the macros in the other workbook. When
you click one of the buttons in the toolbar, it opens the other workbook to
run the macros. And if it can't find the workbook (maybe it got deleted,
which is a possiblity for this application), it croaks.

This is driving me nuts. Should I be using a different approach to managing
this toolbar & getting it to point to the right macros?

Wishing I knew a little more about Excel...

--Doug