Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to lock the path to a macro
Can someone tell me how I can lock the path to a macro that I assigned to a
command button? Every time I copy the spread sheet from the server to my hard drive the path to the macro is changed to match the location of the work book. Using Excel 2000. Thanks! Johnny |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to lock the path to a macro
No. "It is a feature, not a bug." <<grin
Regards BrianB ============================================== "JVS" wrote in message ... Can someone tell me how I can lock the path to a macro that I assigned to a command button? Every time I copy the spread sheet from the server to my hard drive the path to the macro is changed to match the location of the work book. Using Excel 2000. Thanks! Johnny |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to lock the path to a macro
Is there a work around or an alternate solution?
I have a time sheet workbook that I am about to issue to approx 200 associates. I'd like to issue it with no macro's, but was hoping to use a command button to link to a second "master book" that would contain the macros required to fix what the users mess up. Any help would be greatly appreciated! Thanks! Johnny "BrianB" wrote in message om... No. "It is a feature, not a bug." <<grin Regards BrianB ============================================== "JVS" wrote in message ... Can someone tell me how I can lock the path to a macro that I assigned to a command button? Every time I copy the spread sheet from the server to my hard drive the path to the macro is changed to match the location of the work book. Using Excel 2000. Thanks! Johnny |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to lock the path to a macro
Hi Johnny,
Have you considered opening a ReadOnly copy of the Master Book and shifting it behind the Slave Book? If it's open, your button clicks won't need a path (See below). The following may give you some ideas: 'SlaveBook.xls 'IN A SHEET OBJECT Private Sub CommandButton1_Click() Call OpenMaster End Sub Private Sub CommandButton2_Click() 'USE SOME VALID MasterBook.xls PROCEDURE HERE Application.Run "MasterBook.xls!TstMasterSub" 'NO PATH REQUIRED HERE End Sub 'SlaveBook.xls 'IN A MODULE 'CALL FROM A BUTTON CLICK, AUTO_OPEN, OR?? Sub OpenMaster() Application.ScreenUpdating = False Workbooks.Open _ Filename:="\\your\fixed\path\to\MasterBook.xls", _ ReadOnly:=True ThisWorkbook.Activate End Sub 'SlaveBook.xls 'IN THE WORKBOOK OBJECT 'DON'T LEAVE THE MASTERBOOK.XLS FILE OPEN ALONE Private Sub Workbook_BeforeClose(Cancel As Boolean) For Each wb In Workbooks If wb.Name = "MasterBook.xls" Then _ wb.Close savechanges:=False Next End Sub 'MasterBook.xls 'IN THE WORKBOOK OBJECT Private Sub Workbook_Open() If Workbooks.Count = 1 Then ThisWorkbook.Close savechanges:=False Else 'TRIGGER ANY VALID AUTO_OPENS HERE MsgBox "Master Book Opened" End If End Sub Best Regards, Walt Weber -----Original Message----- Is there a work around or an alternate solution? I have a time sheet workbook that I am about to issue to approx 200 associates. I'd like to issue it with no macro's, but was hoping to use a command button to link to a second "master book" that would contain the macros required to fix what the users mess up. Any help would be greatly appreciated! Thanks! Johnny "BrianB" wrote in message . com... No. "It is a feature, not a bug." <<grin Regards BrianB ============================================== "JVS" wrote in message .. . Can someone tell me how I can lock the path to a macro that I assigned to a command button? Every time I copy the spread sheet from the server to my hard drive the path to the macro is changed to match the location of the work book. Using Excel 2000. Thanks! Johnny . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
File Path - Macro | Excel Worksheet Functions | |||
how do i lock the external file (link) path so that it does not ch | Excel Discussion (Misc queries) | |||
how do i lock the external file (link) path so that it does not ch | Excel Discussion (Misc queries) | |||
Custom Toolbar Macro - Path Name | Excel Discussion (Misc queries) | |||
How to remove path from macro reference | Excel Discussion (Misc queries) |