Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel file Copy Prevention/Restriction
I have an excel file which i've spent blooming ages working on, and no that i've come to implement this in our works shop i don't want an employee copying this file from the computer taking in home, messin around with it and cracking passwords etc etc... Solutions to this are few and far between. I tried download.com fo anything but all i could find was software to prevent unauthorise copying of .exe files. Searching the forums here it seems the concensus is that you can' prevent copying of an excel file, just make it a lot harder. So, i'd like it if anyone had any ideas to post here so i can make i as difficult as possible for someone to copy an excel file. Dave Peterson suggested a macro to check the file path and if it wa incorrect then fail to proceed etc... http://www.excelforum.com/showthread...vention+ file I've seen solutions for having a blank page startup unless wit worksheets very hidden unless a password is entered correctly. These make it difficult to use an excel file once it has been take away, but doesn't make it difficult to copy in the first place. For my own suggestion i'd say have a file that is just once opened requests a password and then opens the correct file from a hidde location (i'm sure i've seen this suggested before). This makes it little harder to copy. But, I'd like to take this one step further. Is it possible to prevent the search facilty in windows? Because th problem with the method above is that someone only needs to searc hidden folders/files to find the file. I'm all out of suggestions. Anyone else?? -- chris10 ----------------------------------------------------------------------- chris100's Profile: http://www.excelforum.com/member.php...fo&userid=2516 View this thread: http://www.excelforum.com/showthread.php?threadid=57130 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel file Copy Prevention/Restriction
Chris here's a link to where i posed the question http://www.excelforum.com/showthread.php?t=553507 or you could try coding in your Auto_open the exact file path i.e if thisworkbook.path < "and then put in your filepath to an obscure named folder perhaps" then KillActive Try this below, its not fool proof but you can set the file path and if the workbook is opened not in the specified path it will delete itself! However, deleting something on another persons computer is classed as "virus activity" and should not be carried out without you stating your intentions! Sub Auto_Open() If Thisworkbook.Path < "YOUR PATH HERE" Then Call KillActive End If End Sub Sub KillActive() dim sName as String On Error Resume Next sName = ThisWorkbook.FullName Application.DisplayAlerts = False ThisWorkbook.ChangeFileAccess xlReadOnly Kill sName Application.DislayAlerts = True ThisWorkbook.Close SaveChanges:=False End Sub -- Simon Lloyd ------------------------------------------------------------------------ Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708 View this thread: http://www.excelforum.com/showthread...hreadid=571307 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel file Copy Prevention/Restriction
Hello Chris,
Save as PDF ? as far as security ins concerned, better don't use excel then. Regards JY "chris100" wrote in message ... I have an excel file which i've spent blooming ages working on, and now that i've come to implement this in our works shop i don't want any employee copying this file from the computer taking in home, messing around with it and cracking passwords etc etc... Solutions to this are few and far between. I tried download.com for anything but all i could find was software to prevent unauthorised copying of .exe files. Searching the forums here it seems the concensus is that you can't prevent copying of an excel file, just make it a lot harder. So, i'd like it if anyone had any ideas to post here so i can make it as difficult as possible for someone to copy an excel file. Dave Peterson suggested a macro to check the file path and if it was incorrect then fail to proceed etc... http://www.excelforum.com/showthread...vention+ file I've seen solutions for having a blank page startup unless with worksheets very hidden unless a password is entered correctly. These make it difficult to use an excel file once it has been taken away, but doesn't make it difficult to copy in the first place. For my own suggestion i'd say have a file that is just once opened, requests a password and then opens the correct file from a hidden location (i'm sure i've seen this suggested before). This makes it a little harder to copy. But, I'd like to take this one step further. Is it possible to prevent the search facilty in windows? Because the problem with the method above is that someone only needs to search hidden folders/files to find the file. I'm all out of suggestions. Anyone else??? -- chris100 ------------------------------------------------------------------------ chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166 View this thread: http://www.excelforum.com/showthread...hreadid=571307 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel file Copy Prevention/Restriction
HI again,
Your suggestion : For my own suggestion i'd say have a file that is just once opened, requests a password and then opens the correct file from a hidden location (i'm sure i've seen this suggested before). This makes it a Remove the .xls extention from your hidden location or even rename it before opening it. (just to try confusing people) Regards JY "chris100" wrote in message ... I have an excel file which i've spent blooming ages working on, and now that i've come to implement this in our works shop i don't want any employee copying this file from the computer taking in home, messing around with it and cracking passwords etc etc... Solutions to this are few and far between. I tried download.com for anything but all i could find was software to prevent unauthorised copying of .exe files. Searching the forums here it seems the concensus is that you can't prevent copying of an excel file, just make it a lot harder. So, i'd like it if anyone had any ideas to post here so i can make it as difficult as possible for someone to copy an excel file. Dave Peterson suggested a macro to check the file path and if it was incorrect then fail to proceed etc... http://www.excelforum.com/showthread...vention+ file I've seen solutions for having a blank page startup unless with worksheets very hidden unless a password is entered correctly. These make it difficult to use an excel file once it has been taken away, but doesn't make it difficult to copy in the first place. For my own suggestion i'd say have a file that is just once opened, requests a password and then opens the correct file from a hidden location (i'm sure i've seen this suggested before). This makes it a little harder to copy. But, I'd like to take this one step further. Is it possible to prevent the search facilty in windows? Because the problem with the method above is that someone only needs to search hidden folders/files to find the file. I'm all out of suggestions. Anyone else??? -- chris100 ------------------------------------------------------------------------ chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166 View this thread: http://www.excelforum.com/showthread...hreadid=571307 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel file Copy Prevention/Restriction
Hi guys, Thanks for the suggestions. With regards to changing the file extension, i'm not sure how i could do that and still open the file to run normally. I tried messing around with saving as different extensions but with no luck. Mr llyod, i like your method and i'm going to try after i finish this post. Fortunately the files we use are all in house so we can ignore the whole virus thing. Thanks again. -- chris100 ------------------------------------------------------------------------ chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166 View this thread: http://www.excelforum.com/showthread...hreadid=571307 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel file Copy Prevention/Restriction
Simon, I tried the "kill" method which i thought was pretty good. I change the file path as directed but although it killed the file in an different directory, it also killed it when i tried to open the file i the correct directory! I'm no where near an expert at VBA so here is the line of code i use in case i spazzed somewhe If ThisWorkbook.Path < "C:\Documents an Settings\Owner\Desktop\TESTDELETE.xls" Then Opening the file from that location killed it. Please let me kno where i'm going wrong. Regards, Chri -- chris10 ----------------------------------------------------------------------- chris100's Profile: http://www.excelforum.com/member.php...fo&userid=2516 View this thread: http://www.excelforum.com/showthread.php?threadid=57130 |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel file Copy Prevention/Restriction
Chris i read your line and cant imagine that your user name or your area n the computer is called owner so i assume thats why it deleted the file, try just dropping the "Owner" portion of your path, but you should save it in a folder on the desktop because that folder will not exist on your users desktop! Just a thought, Regards, Simon -- Simon Lloyd ------------------------------------------------------------------------ Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708 View this thread: http://www.excelforum.com/showthread...hreadid=571307 |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel file Copy Prevention/Restriction
hi Simon, Tried what you said but same result. I'll play around with it in the morning and see if something else works. regards chris -- chris100 ------------------------------------------------------------------------ chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166 View this thread: http://www.excelforum.com/showthread...hreadid=571307 |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel file Copy Prevention/Restriction
Just spent a bit of time messing around with this. Really odd. I used the code below to test and although it ran through to KillActive in a different directory, it also did the same in the correct directory. Sub Auto_Open() If ThisWorkbook.Path < "C:\Documents and Settings\OWNER\Desktop\Book2.xls" Then Call KillActive End If End Sub Sub KillActive() MsgBox ("heelo") End Sub I checked the file path by copying and pasting into Run and it opened the file fine. Any ideas, thoughts, suggestions and otherwise help on a postcard please. :) Thanks Chris -- chris100 ------------------------------------------------------------------------ chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166 View this thread: http://www.excelforum.com/showthread...hreadid=571307 |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel file Copy Prevention/Restriction
Hi Chris,
Change : If ThisWorkbook.Path < "C:\Documents and Settings\OWNER\Desktop\Book2.xls" To If ThisWorkbook.Path < "C:\Documents and Settings\OWNER\Desktop" Regards JY "chris100" wrote in message ... Just spent a bit of time messing around with this. Really odd. I used the code below to test and although it ran through to KillActive in a different directory, it also did the same in the correct directory. Sub Auto_Open() If ThisWorkbook.Path < "C:\Documents and Settings\OWNER\Desktop\Book2.xls" Then Call KillActive End If End Sub Sub KillActive() MsgBox ("heelo") End Sub I checked the file path by copying and pasting into Run and it opened the file fine. Any ideas, thoughts, suggestions and otherwise help on a postcard please. :) Thanks Chris -- chris100 ------------------------------------------------------------------------ chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166 View this thread: http://www.excelforum.com/showthread...hreadid=571307 |
#11
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel file Copy Prevention/Restriction
Thanks Jean-Yves. I tried what you suggested but still no luck. Could or or anyone else give this a go to see if it works? I'm lost!! Regards, Chris -- chris100 ------------------------------------------------------------------------ chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166 View this thread: http://www.excelforum.com/showthread...hreadid=571307 |
#12
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel file Copy Prevention/Restriction
Having a look around i found this piece of code submitted by Dave Peterson: http://www.excelforum.com/showthread...heck+path+file option explicit sub workbook_open() dim myPath as string mypath = "c:\book2" if lcase(me.path) < lcase(mypath) then Application.DisplayAlerts=False me.ChangeFileAccess xlReadOnly Kill me.FullName me.Close savechanges:=False end if end sub Working with the above i took the filename back to basics and just kept it on the C:\ location. It didn't kill the file in the correct location but nor did it kill in a different location! What the hell have i done to screw this up? I'm confused.... P.s obviously be careful using the above code on anything you want to keep (doh) -- chris100 ------------------------------------------------------------------------ chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166 View this thread: http://www.excelforum.com/showthread...hreadid=571307 |
#13
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel file Copy Prevention/Restriction
Chris looking at the code it changes the file to read only!, does the file left on your computer say read only on the top left when you open it? Regards, Simon -- Simon Lloyd ------------------------------------------------------------------------ Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708 View this thread: http://www.excelforum.com/showthread...hreadid=571307 |
#14
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel file Copy Prevention/Restriction
Hi Simon, No it doesn't change to read only when opening in the correct or incorrect location. Someone hit me with a ficky stick. Regards, Chris -- chris100 ------------------------------------------------------------------------ chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166 View this thread: http://www.excelforum.com/showthread...hreadid=571307 |
#15
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel file Copy Prevention/Restriction
Sorted Chris!, you had the filename in the wrong place and of course i your using XP, ME, 2000 you have a username which of course was missin and thats why it would delete anywhere heres the revised code substitut your own criteria.....P.S i think the folder name is case sensitiv too! Regards, Simon Option Explicit Sub Auto_Open() If ThisWorkbook.Path = "C:\Documents and Settings\Simon\Desktop\Testit Then Exit Sub ElseIf ThisWorkbook.Path < "C:\Documents an Settings\Simon\Desktop\Testit" Then Call KillActive End If End Sub Sub KillActive() Dim sName As String On Error Resume Next sName = ThisWorkbook.FullName Application.DisplayAlerts = False ThisWorkbook.ChangeFileAccess xlReadOnly Kill sName Application.DislayAlerts = True ThisWorkbook.Close SaveChanges:=False End Su -- Simon Lloy ----------------------------------------------------------------------- Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670 View this thread: http://www.excelforum.com/showthread.php?threadid=57130 |
#16
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel file Copy Prevention/Restriction
Thanks Simon but for some reason it doesn't work. I'm about to kill th computer instead! What i'll do is try it out on a different computer if for some reaso that will make a difference......ummh. If i haven't thrown the computer out of the window i'll post th result. Thanks & Regards, Chri -- chris10 ----------------------------------------------------------------------- chris100's Profile: http://www.excelforum.com/member.php...fo&userid=2516 View this thread: http://www.excelforum.com/showthread.php?threadid=57130 |
#17
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel file Copy Prevention/Restriction
Well Chris it worked fine for me, created a folder called Testit and saved the workbook in there i then copied the workbook and placed it on the desktop, when i opened the one on the desktop it got deleted but when i opened the workbook in the folder Testit it did not get deleted. I can't understand whats going on with yours? regards, Simon -- Simon Lloyd ------------------------------------------------------------------------ Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708 View this thread: http://www.excelforum.com/showthread...hreadid=571307 |
#18
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel file Copy Prevention/Restriction
Ok Simon, I think i've almmost clocked it. I was confused thinking that "Testit" in your code was the filename! I have it now that it works with basic folders e.g c:\Testit\Test2. I having tested it extensively but i'm pretty sure that was causing the problem. Thank you very very very much Simon and others. You can definately hit me with that Ficky Stick.... Thanks again and regards, Chris -- chris100 ------------------------------------------------------------------------ chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166 View this thread: http://www.excelforum.com/showthread...hreadid=571307 |
#19
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel file Copy Prevention/Restriction
Consider yourself severly whacked! Regards, Simon -- Simon Lloyd ------------------------------------------------------------------------ Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708 View this thread: http://www.excelforum.com/showthread...hreadid=571307 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Prevention of Printing | Excel Discussion (Misc queries) | |||
Overcoming the restriction of 7 nested IFs in Excel XP. Is it possible? | Excel Worksheet Functions | |||
question about some excel restriction script running on ... | Excel Discussion (Misc queries) | |||
prevention emergency kay - for experts | Excel Programming | |||
add restriction in Excel | Excel Worksheet Functions |