Identify Load Drive
Brian,
To the best of my knowledge if a user does not enable macros they can do
just about anything they want (depending on their skill level).
The closest I can come to preventing this is to make an add-in with all the
code. Than have the user launch the workbook from the add-in. I have also
heard of using DLL's but am not familiar with that approach.
Bottom line is that Excel is not really tamper proof.
But when you can control the workbook with code - you can pretty much do
just about anything.
In code
MsgBox Application.ActiveWorkbook.FullName
returns the path and file name of the workbook
DriveLetter = Left(Application.ActiveWorkbook.FullName,1)
As you are aware - leave a sheet with the message and hiding all the other
sheets on Workbook Close is the best you can achieve. Than on Workbook Open
you can hide the first and show the others. These codes belong in the
ThisWorkbook module. But only work if macros are enabled.
You can even set up code to delete sheets.
Post back if you need more specific code and other info.
--
steveB
Remove "AYN" from email to respond
"Brian C" wrote in message
...
Thanks Guys!
I actually already disabled the save/save as, and made it so that the
sheets are veryhidden and tells the user that the workbook can't be used
if
macros are disabled. So, the last piece is to prevent someone from
disabling
the macros as they launch the sheet, and then saving it on their c drive.
If
they do that and load from C, it will give message "Must Enable Macros"
and
the other sheets will be veryhidden.
If they enable macros, then I need this macro to detect the launch drive,
and if it's C or D, then delete the "Input" and "Calculations" sheets so
they
can't use. Then create a message box that tells them they have to launch
it
from the posted location. I've been working on the code, but can't get it
quite right. I'm pretty new to VBA.
|