Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: disable a macro if current file is not specified file?

Started 1 month, 2 weeks ago by mfarah
Hello, I have an autosave macro that runs at a specified time but only if the file is open. What i have found is that when others make a copy of the file the marco still runs as there is no check on the name or location of the file before the macro is activated. how do i check the file and the path and then disable (not run it) the macro if the name or the path it is is not as I have ...
Site: MrExcel Message Board  MrExcel Message Board - site profile
Forum: Excel Questions  Excel Questions - forum profile
Total authors: 2 authors
Total thread posts: 5 posts
Thread activity: no new posts during last week
Domain info for: mrexcel.com

Other posts in this thread:

Andrew Poulsom replied 1 month, 2 weeks ago
ActiveWorkbook.FullName will return the path and name.

mfarah replied 1 month, 2 weeks ago
Quote: Originally Posted by Andrew Poulsom ActiveWorkbook.FullName will return the path and name. not sure I'll ever getthe hang of this - I've got this but there is a compile error Quote: Sub Workbook_Open() Dim thisWorkbook As String thisWorkbook = Workbooks("09_10 Integrated IS...

Andrew Poulsom replied 1 month, 2 weeks ago
That code compiles for me. But ActiveWorkbook.FullName includes the path. Why are you just comparing it with the equivalent of ActiveWorkbook.Name? Incidentally, I think you should be using ThisWorkbook (or Me) rather than ActiveWorkbook.

mfarah replied 1 month, 2 weeks ago
thanks for your advice - I'm ovbviously on the right track - will keep plugging along

 

Top contributing authors

Name
Posts
mfarah
6
user's latest post:
disable a macro if current file...
Published (2009-11-10 16:33:00)
thanks for your advice - I'm ovbviously on the right track - will keep plugging along
Andrew Poulsom
4
user's latest post:
disable a macro if current file...
Published (2009-11-10 16:30:00)
That code compiles for me. But ActiveWorkbook.FullName includes the path. Why are you just comparing it with the equivalent of ActiveWorkbook.Name? Incidentally, I think you should be using ThisWorkbook (or Me) rather than ActiveWorkbook.

Related threads on "MrExcel Message Board":

Related threads on other sites:

Thread profile page for "disable a macro if current file is not specified file?" on http://www.mrexcel.com. This report page is a snippet summary view from a single thread "disable a macro if current file is not specified file?", located on the Message Board at http://www.mrexcel.com. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity