I still can't help but think that you are making this harder than it
seems. Your objective is to ensure the program is coming from your
network, or at least that the user is connected to the network.
Regardless, the template (XLT) will reside in a specific location on the
network. When the program opens, it checks for the XLT file NOT the
newly opened XLS file. Since the XLT is already on the network you can
check for it, and if it is there then run the program.
Another option is to automatically save the newly opened XLS file to a
specific location on the network upon the file being opened. If the
network is not available you can shut the program down.