Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to protect file from being copied?

Status
Not open for further replies.

sagitt

Technical User
Dec 2, 2009
8
0
0
IE
Hi All,

Here is my problem, I have a few macros and I cannot put an expiration date on them.
I want prevent macros to be unauthorised copied and used.
The way I do it on excel is simple:

If ThisWorkbook.Fullname <> ' my path' Then Exit Sub

So nobody is able to execute a copy of a spreadsheet from folder than this where a macro file is stored.

Does anybody know how to get around this in attachmate, what would be a ThisWorkbook thing in Extra Basic?

regards
Sagit
 


Sagit,

Anyone who is at all VB savy, can get around your trap, by opening the workbook while disabeling macros, unless you've done some other fancy coding.

To my knowledge, Extra VB has no such events. In fact, Extra VB is much more elemental than Excel VBA.

You'd probably need a VB executable that would run your Extra application A to Z.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Skip,

The reason for trap is very simple. I do a macros for a group of an users. Macros are stored in some shared locations. Users often copy macros to their personal storage locations. Any time I have a new, updated and free from bugs version, I save it to shared location. Date protection ensured me that old copies sooner or later will expired and users will not be able to use it.

There are some reasons I cannot use date expiration trap anymore. So I set up so call 'trap' as described in post. Ordinary user will not have a clue how to get around that trap, advanced user will understand reasons and will not use old copies.

Does it make any sense?

Maybe you have some other ideas how to get around this (hope).

Regards,
Sagit
 
As a thought, you could put a "check file" containing the current version number in the shared storage location then do something like

dim ver
Open [checkfile] for input as #1
lineinput #1,ver
close #1
if ver<> [current version number] then
msgbox "wrong version"
goto [end of macro]
end if

Every time you change the macro, you increment the version number in the check file. Then it doesn't matter if people copy the macro, it will work until you update it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top