I want to prevent code in the Workbook_Open module running if the file is not in a specific location – i.e. if it’s been emailed to someone else or copied.
Is it possible to use ThisWorkbook.Path without specifying the whole path? The original file will be in one of various subfolders, so the first part will not change. I tried it using a wildcard but it doesn't work – something like this:
If ThisWorkbook.Path <> "K:\Shared\Reports\Sales\*" Then
(where * would be a monthly folder)
BTW this is not a security issue, I just don’t want recipients to see the user options msgbox when they open the file.