The reason I want to do this is this: after the file has been 1) loaded onto the target PC harddrive AND 2) opened, if the file is then copied to someone else's PC, it will not be fully functional because I want the progam (VBA) to determine that it has already been opened. If it does determine that, it will render the spreadsheet less than fully functional
I know this is approach is not fool-proof but I also implemented the following rules to my procedures: when I send the file out, it has the users name at the top of the main sheet showing who the file belongs to with the idea that it will reduce the desire for someone to give a copy to another person before the person I send it to opens it
Another procedure rule I've implemented to tighten the security on this file is that each time the file is opened, it is opened using a set of randomly generated passwords from the previous time it was opened. Obviously the first time it is opened, it is opened without the need for passwords but once opened it is immedialy secured with brand new randomly created passwords - ain't pretty but seems to work. In summary, Here are the steps regarding my password methods..
OPENING THE FILE..
1) ...the first time without VBA using passwords (one-time). I send the file without password protection
2) VBA immediatly applies passwords by using radomly generated passwords from functions on a hidden sheet
3) VBA then password-protects the workbook and all the sheets using the new passwords
CLOSING THE FILE..
4) VBA resets the disable switch to ON
6) VBA resets the passwords again using the random generated procedure again (same as #2 above
7) VBA force saves the file
8) file is closed
-Warre
----- Harlan Grove wrote: ----
Warren said:
1) Is there a way to identify a PC that excel is running on? I.e., I
address maybe?
2) If there is, can I use VBA to somehow grab the id/name
3) If so, what would the code look like
What do you want to do with this? Identify a particular machine each tim
your workbook is opened on it? Something else
If IP numbers are dynamically assigned, then a particular IP number may b
assigned to PC A one day and PC X another day. Only if your users all hav
static IP numbers (very unlikely for desktops in most Windows networks
would IP number identify the same PC all the time
One way to identify the same C: drive between sessions would be to use Shel
to run the command processor's DIR command redirected to a temporary file
then read the disk serial number from that file using VBA's Open, Input an
Close statements