ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Problem with macros in custom excel template (https://www.excelbanter.com/excel-discussion-misc-queries/177297-problem-macros-custom-excel-template.html)

return2300

Problem with macros in custom excel template
 
I'm trying to create templates in Excel 2003 that will be copied from a
single network location. I created a toolbar to access the macros for this
template and as
the person who created them they work fine for me, but when anyone else tries
to access them the macros don't work from the toolbar. I've gone into the
macro window and they're all present and work when I run them from there, but
the average user will of course not go that route. I've gone in to the
template multiple times to reattach the macros to the toolbar and every time
the macro resets to saying Book.xlt!insertworksheet instead of
insertworksheet. The error that users see say that book.xls cannot be
located. Does anyone know how to get around this problem?


Gord Dibben

Problem with macros in custom excel template
 
Save yourself this kind of grief by creating a Toolbar when the Template is run.

The buttons will be assigned to the active workbook which is the one just
created by the Template.

Leave the macros in the Template as is but add Workbook_Open code to create the
Toolbar and Workbook_BeforeClose to delete it when the new book is saved and
closed.

See Debra Dalgleish's site for instructions and code.

http://www.contextures.on.ca/xlToolbar02.html

Note: Dave uses the Auto_Open and Close events, not the Workbook_Open and Close
events.

Same thing and with Dave's method, all code goes into a single module for ease
of copying.


Gord Dibben MS Excel MVP

On Wed, 20 Feb 2008 11:30:02 -0800, return2300
wrote:

I'm trying to create templates in Excel 2003 that will be copied from a
single network location. I created a toolbar to access the macros for this
template and as
the person who created them they work fine for me, but when anyone else tries
to access them the macros don't work from the toolbar. I've gone into the
macro window and they're all present and work when I run them from there, but
the average user will of course not go that route. I've gone in to the
template multiple times to reattach the macros to the toolbar and every time
the macro resets to saying Book.xlt!insertworksheet instead of
insertworksheet. The error that users see say that book.xls cannot be
located. Does anyone know how to get around this problem?




All times are GMT +1. The time now is 12:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com