Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JVS JVS is offline
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default 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   Report Post  
Posted to microsoft.public.excel.programming
JVS JVS is offline
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default 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
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
File Path - Macro Max2073 Excel Worksheet Functions 1 December 6th 09 11:57 AM
how do i lock the external file (link) path so that it does not ch Setagaya Japan Excel Discussion (Misc queries) 0 February 9th 09 05:47 AM
how do i lock the external file (link) path so that it does not ch Setagaya Japan[_2_] Excel Discussion (Misc queries) 0 February 9th 09 05:47 AM
Custom Toolbar Macro - Path Name Karin Excel Discussion (Misc queries) 6 February 5th 07 06:47 PM
How to remove path from macro reference seppo Excel Discussion (Misc queries) 2 February 22nd 06 07:08 AM


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

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"