Results 1 to 5 of 5

VBA to validate UNC path

Threaded View

  1. #1
    Registered User
    Join Date
    07-09-2014
    Location
    Lisbon
    MS-Off Ver
    Microsoft Office 365 ProPlus Version 1708 (build 8431.2153)
    Posts
    62

    Question VBA to validate UNC path

    Hi everyone,

    I'm failing to get this working.
    So, I have a file save on a shared drive that anyone can map differently (M: Z: etc). The thing is, that file can only be used THERE, so if they copy and open it from any other place, the file is deleted.

    I've defined "Path" to be on cell B8 as this: \\IRLDUB02.eu.company.net\swg03\ABC\

    The piece of code is:
    Path = ThisWorkbook.Worksheets("copyright").Range("B8").Value
    
    If Application.ActiveWorkbook.Path <> Path Then
            MsgBox "This local copy of the Tool will be closed."
            Call Selfdestruction
    As I can understand the problem is that Application.ActiveWorkbook.Path is "reading" the mapped path. E.G. Z:\ABC instead of the UNC one.
    Does someone know how can I force it to use the UNC instead?

    Thank you.
    Last edited by no_Fate; 01-10-2018 at 01:16 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to validate an input dat folder/directory path whether the path has any spaces
    By mahendra.asapu in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-21-2015, 02:39 AM
  2. Replies: 1
    Last Post: 11-26-2013, 08:46 PM
  3. Variable .Attachment.Add path using Function to pull path from word table
    By aavelyn in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-27-2013, 10:07 PM
  4. Macro with condition of Period, before run, macro should validate the date and Path of fil
    By caapoorvajain in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-17-2012, 04:11 AM
  5. How to set GetOpenfile dialog start path to current open files path.
    By Michael Wise in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-03-2010, 02:24 PM
  6. Validate two fields when one field you need a formula to validate
    By cmwilbur in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-29-2010, 11:32 AM
  7. Replies: 7
    Last Post: 10-09-2009, 10:10 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1