Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Restricting VBA macros
How can I force a workbook to always use the macros stored in tha
workbook even if I do a file save as? The macros in the original file after I do a save as, point to the newly saved as file, so when I ope the original one, all the macros faile 'cause they are pointing to th saved as file. HELP!!!!! thanks:( :confused -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Restricting VBA macros
Write code to go through and change them back. (I assume you are talking
about toolbar onaction macros). Here is some code posted recently by Bernie Deitrick: Sub RepairUserDefinedButtons3() Dim CmdBar As CommandBar Dim i As Integer On Error GoTo ErrorReading: For Each CmdBar In CommandBars For i = 1 To CmdBar.Controls.Count If CmdBar.Controls(i).BuiltIn = False Then If InStr(1, CmdBar.Controls(i).OnAction, _ "my-macros.xls") Then CmdBar.Controls(i).OnAction = _ Replace(CmdBar.Controls(i).OnAction, _ "my-macros.xls", "my-macros.xla") End If End If ErrorReading: Next i Next CmdBar End Sub Change my-macros.xls to the saved as workbook name and my-macros.xls to the original workbook name. -- Regards, Tom Ogilvy "halem2 " wrote in message ... How can I force a workbook to always use the macros stored in that workbook even if I do a file save as? The macros in the original file, after I do a save as, point to the newly saved as file, so when I open the original one, all the macros faile 'cause they are pointing to the saved as file. HELP!!!!! thanks:( --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Restricting entry | Excel Worksheet Functions | |||
restricting use of certain characters | Excel Discussion (Misc queries) | |||
Restricting Rows | Excel Discussion (Misc queries) | |||
restricting fonts | Excel Programming | |||
Restricting cells | Excel Programming |