Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use a range of time to assign a score? Steve Excel Discussion (Misc queries) 6 July 14th 09 10:00 PM
Assign a code to a range of time Elizabeth Excel Worksheet Functions 15 October 28th 07 06:42 PM
Excel macro's to run at a scheduled time Pramod Kamath Excel Discussion (Misc queries) 1 August 15th 06 02:04 PM
Hide Macro's in Toolbar / Macro's list sparx Excel Discussion (Misc queries) 2 May 6th 06 08:53 PM
assign value for period of time AG Excel Discussion (Misc queries) 2 May 18th 05 01:32 PM


All times are GMT +1. The time now is 10:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"