Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why do i have to re-assign macro's all the time
I have four work books which all have pretty much the same code apar
from a few minor changes, and they all use some custom menu bars (th same for each workbook)......my problem is this...when i re-open th workbook on another networked machine i have to re-assign macros or i i open one workbook close it and open another i have to re-assign...wh is this? is there a solution? Simo -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why do i have to re-assign macro's all the time
You need to assign/unassign the macros to the buttons when the workbook is
opened. Here is the example solution for a toolbar, menus are similar. Sub Auto_open() Toolbars("LogForm").Visible = True Toolbars("LogForm").ToolbarButtons(1).OnAction = "PhoneLogger" Toolbars("LogForm").ToolbarButtons(2).OnAction = "LateLogger" End Sub Sub Auto_close() On Error Resume Next Toolbars("LogForm").ToolbarButtons(1).OnAction = "" Toolbars("LogForm").ToolbarButtons(2).OnAction = "" Toolbars("LogForm").Visible = False Toolbars("LogForm").Delete On Error GoTo 0 End Sub HTH, Greg "Simon Lloyd " wrote in message ... I have four work books which all have pretty much the same code apart from a few minor changes, and they all use some custom menu bars (the same for each workbook)......my problem is this...when i re-open the workbook on another networked machine i have to re-assign macros or if i open one workbook close it and open another i have to re-assign...why is this? is there a solution? Simon --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why do i have to re-assign macro's all the time
Hi Greg, thanks fro the reply, i created a menubar which has fou
buutons on it, for arguement sake lets say they are called today tomorrow, yesterday and daybefore lets say the menuar is calle everyday......should i replace your titles i.e "PHONELOGGER" with m button name? i.e "TODAY" I already turn the menubar on and off in auto_open/close with With Application .CommandBars("Whateverday").Visible = True, but on opening a differen workbook that also uses this bar i have to re-asign macros, then whe opening the original again i have to re-assign again. How do i actually assign the named macros to the named buttons on th command bars in VBA in the auto_open? Sorry for seeming a bit dense but ive only been at VB/VBa for about weeks. Simo -- Message posted from http://www.ExcelForum.com |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why do i have to re-assign macro's all the time
In addition to the above how do i determine which is button
1,2,3,4?....i created a new menubar dragged it to the top of the screen and then dragged some custom buttons on to it and did all the usual re-naming and stuff! Simon --- Message posted from http://www.ExcelForum.com/ |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why do i have to re-assign macro's all the time
Can anyone shed a little extra light on the above....call me thick bu
im having a little trouble fathoming it out! Simo -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to use a range of time to assign a score? | Excel Discussion (Misc queries) | |||
Assign a code to a range of time | Excel Worksheet Functions | |||
Excel macro's to run at a scheduled time | Excel Discussion (Misc queries) | |||
Hide Macro's in Toolbar / Macro's list | Excel Discussion (Misc queries) | |||
assign value for period of time | Excel Discussion (Misc queries) |