Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old September 1st 09, 10:37 AM posted to microsoft.public.excel.misc
external usenet poster
 
First recorded activity by ExcelBanter: Sep 2007
Posts: 21
Default Protect Excel Worksheet to be opened on one PC only

Hello,

I am looking for a solution to protect an Excel document to be opened on one
computer only. On other computers, the Excel document should show a message
like "This document cannot be opened on this computer" or just fail to open.

The idea is to protect intellectual property in that document (and to
prohibit its usage, so a simple cell protection wouldn't be enough).

Third party solutions would be OK too.

Any answers would be highly appreciated!

Thank you,
Fabian

  #2   Report Post  
Old September 1st 09, 10:54 AM posted to microsoft.public.excel.misc
external usenet poster
 
First recorded activity by ExcelBanter: Aug 2009
Posts: 47
Default Protect Excel Worksheet to be opened on one PC only

Hello,

In the "ThisWorkbook" section in the VBE you can use this code to check the
computer ID and then unprotect the spreadsheet so that it can be edited.

Private Sub Workbook_Open()
If Not Environ("ComputerName") = "YourComputerName" Then
Application.Quit
End If
ActiveSheet.Unprotect Password:="YourPassword"
End Sub

then in the same section use ...

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveSheet.Protect Password:="YourPassword", DrawingObjects:=False,
Contents:=True, Scenarios:=True
End Sub

this will password protect your spreadsheet again when you close it.
--
Kevin Smith )


"Fabian" wrote:

Hello,

I am looking for a solution to protect an Excel document to be opened on one
computer only. On other computers, the Excel document should show a message
like "This document cannot be opened on this computer" or just fail to open.

The idea is to protect intellectual property in that document (and to
prohibit its usage, so a simple cell protection wouldn't be enough).

Third party solutions would be OK too.

Any answers would be highly appreciated!

Thank you,
Fabian

  #3   Report Post  
Old September 1st 09, 11:08 AM posted to microsoft.public.excel.misc
external usenet poster
 
First recorded activity by ExcelBanter: Sep 2007
Posts: 21
Default Protect Excel Worksheet to be opened on one PC only

Hi Kevin,

thanks for your answer!

But wouldn't it be possible for the user to not execute macros and to open
the workbook then? OK, it would be protected, but it seems not completely
safe to me.

Fabian

"Kevin Smith" wrote:

Hello,

In the "ThisWorkbook" section in the VBE you can use this code to check the
computer ID and then unprotect the spreadsheet so that it can be edited.

Private Sub Workbook_Open()
If Not Environ("ComputerName") = "YourComputerName" Then
Application.Quit
End If
ActiveSheet.Unprotect Password:="YourPassword"
End Sub

then in the same section use ...

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveSheet.Protect Password:="YourPassword", DrawingObjects:=False,
Contents:=True, Scenarios:=True
End Sub

this will password protect your spreadsheet again when you close it.
--
Kevin Smith )


"Fabian" wrote:

Hello,

I am looking for a solution to protect an Excel document to be opened on one
computer only. On other computers, the Excel document should show a message
like "This document cannot be opened on this computer" or just fail to open.

The idea is to protect intellectual property in that document (and to
prohibit its usage, so a simple cell protection wouldn't be enough).

Third party solutions would be OK too.

Any answers would be highly appreciated!

Thank you,
Fabian

  #4   Report Post  
Old September 1st 09, 11:16 AM posted to microsoft.public.excel.misc
external usenet poster
 
First recorded activity by ExcelBanter: Aug 2009
Posts: 47
Default Protect Excel Worksheet to be opened on one PC only

You are correct that they can bypass the code but if you password protect the
information then all thay will be able to do is view the data rather than
edit it. on the PC that you specify you will not need to unprotect and
protect the date because that is handled in the code.

it is something that i do with excel and access, i check the ComputerName
and User Name. if it is not me then it protects the data and if it is me then
it allows me full access.
--
Kevin Smith )


"Fabian" wrote:

Hi Kevin,

thanks for your answer!

But wouldn't it be possible for the user to not execute macros and to open
the workbook then? OK, it would be protected, but it seems not completely
safe to me.

Fabian

"Kevin Smith" wrote:

Hello,

In the "ThisWorkbook" section in the VBE you can use this code to check the
computer ID and then unprotect the spreadsheet so that it can be edited.

Private Sub Workbook_Open()
If Not Environ("ComputerName") = "YourComputerName" Then
Application.Quit
End If
ActiveSheet.Unprotect Password:="YourPassword"
End Sub

then in the same section use ...

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveSheet.Protect Password:="YourPassword", DrawingObjects:=False,
Contents:=True, Scenarios:=True
End Sub

this will password protect your spreadsheet again when you close it.
--
Kevin Smith )


"Fabian" wrote:

Hello,

I am looking for a solution to protect an Excel document to be opened on one
computer only. On other computers, the Excel document should show a message
like "This document cannot be opened on this computer" or just fail to open.

The idea is to protect intellectual property in that document (and to
prohibit its usage, so a simple cell protection wouldn't be enough).

Third party solutions would be OK too.

Any answers would be highly appreciated!

Thank you,
Fabian

  #5   Report Post  
Old September 1st 09, 11:17 AM posted to microsoft.public.excel.misc
external usenet poster
 
First recorded activity by ExcelBanter: Mar 2009
Posts: 8,520
Default Protect Excel Worksheet to be opened on one PC only

Excel internal security is very weak and passwords can be easily cracked. No
matter how hard you try; any user with the intend of opening the files can
easily google and get a password cracker. So suggest not to use excel to
store such data...

If this post helps click Yes
---------------
Jacob Skaria


"Fabian" wrote:

Hello,

I am looking for a solution to protect an Excel document to be opened on one
computer only. On other computers, the Excel document should show a message
like "This document cannot be opened on this computer" or just fail to open.

The idea is to protect intellectual property in that document (and to
prohibit its usage, so a simple cell protection wouldn't be enough).

Third party solutions would be OK too.

Any answers would be highly appreciated!

Thank you,
Fabian



  #6   Report Post  
Old September 1st 09, 11:29 AM posted to microsoft.public.excel.misc
external usenet poster
 
First recorded activity by ExcelBanter: Sep 2007
Posts: 21
Default Protect Excel Worksheet to be opened on one PC only

ok, thanks for the the code snippet. It could be a solution of last-resort;
problem is that the user needs to allow the Macros (we're dealing with end
users here). And I believe that the built-in Excel protection is not totally
secure (anyone has details about this)?

But anyways, thanks for your help!

"Kevin Smith" wrote:

You are correct that they can bypass the code but if you password protect the
information then all thay will be able to do is view the data rather than
edit it. on the PC that you specify you will not need to unprotect and
protect the date because that is handled in the code.

it is something that i do with excel and access, i check the ComputerName
and User Name. if it is not me then it protects the data and if it is me then
it allows me full access.
--
Kevin Smith )


"Fabian" wrote:

Hi Kevin,

thanks for your answer!

But wouldn't it be possible for the user to not execute macros and to open
the workbook then? OK, it would be protected, but it seems not completely
safe to me.

Fabian

"Kevin Smith" wrote:

Hello,

In the "ThisWorkbook" section in the VBE you can use this code to check the
computer ID and then unprotect the spreadsheet so that it can be edited.

Private Sub Workbook_Open()
If Not Environ("ComputerName") = "YourComputerName" Then
Application.Quit
End If
ActiveSheet.Unprotect Password:="YourPassword"
End Sub

then in the same section use ...

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveSheet.Protect Password:="YourPassword", DrawingObjects:=False,
Contents:=True, Scenarios:=True
End Sub

this will password protect your spreadsheet again when you close it.
--
Kevin Smith )


"Fabian" wrote:

Hello,

I am looking for a solution to protect an Excel document to be opened on one
computer only. On other computers, the Excel document should show a message
like "This document cannot be opened on this computer" or just fail to open.

The idea is to protect intellectual property in that document (and to
prohibit its usage, so a simple cell protection wouldn't be enough).

Third party solutions would be OK too.

Any answers would be highly appreciated!

Thank you,
Fabian

  #7   Report Post  
Old September 1st 09, 11:36 AM posted to microsoft.public.excel.misc
external usenet poster
 
First recorded activity by ExcelBanter: Aug 2009
Posts: 47
Default Protect Excel Worksheet to be opened on one PC only

No problems. Just be careful though because like Jacob said excel is weak in
security and no matter what you do to protect the information someone will be
able to get in if they wanted to.
--
Kevin Smith )


"Fabian" wrote:

ok, thanks for the the code snippet. It could be a solution of last-resort;
problem is that the user needs to allow the Macros (we're dealing with end
users here). And I believe that the built-in Excel protection is not totally
secure (anyone has details about this)?

But anyways, thanks for your help!

"Kevin Smith" wrote:

You are correct that they can bypass the code but if you password protect the
information then all thay will be able to do is view the data rather than
edit it. on the PC that you specify you will not need to unprotect and
protect the date because that is handled in the code.

it is something that i do with excel and access, i check the ComputerName
and User Name. if it is not me then it protects the data and if it is me then
it allows me full access.
--
Kevin Smith )


"Fabian" wrote:

Hi Kevin,

thanks for your answer!

But wouldn't it be possible for the user to not execute macros and to open
the workbook then? OK, it would be protected, but it seems not completely
safe to me.

Fabian

"Kevin Smith" wrote:

Hello,

In the "ThisWorkbook" section in the VBE you can use this code to check the
computer ID and then unprotect the spreadsheet so that it can be edited.

Private Sub Workbook_Open()
If Not Environ("ComputerName") = "YourComputerName" Then
Application.Quit
End If
ActiveSheet.Unprotect Password:="YourPassword"
End Sub

then in the same section use ...

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveSheet.Protect Password:="YourPassword", DrawingObjects:=False,
Contents:=True, Scenarios:=True
End Sub

this will password protect your spreadsheet again when you close it.
--
Kevin Smith )


"Fabian" wrote:

Hello,

I am looking for a solution to protect an Excel document to be opened on one
computer only. On other computers, the Excel document should show a message
like "This document cannot be opened on this computer" or just fail to open.

The idea is to protect intellectual property in that document (and to
prohibit its usage, so a simple cell protection wouldn't be enough).

Third party solutions would be OK too.

Any answers would be highly appreciated!

Thank you,
Fabian

  #8   Report Post  
Old September 1st 09, 11:59 AM posted to microsoft.public.excel.misc
external usenet poster
 
First recorded activity by ExcelBanter: Aug 2009
Posts: 47
Default Protect Excel Worksheet to be opened on one PC only

Another option would be

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheets("Sheet2").Visible = xlVeryHidden
End Sub

The Very Hidden statement means that the sheet can not be displayed through
the normal options "Format-Sheets-Unhide" It can only be displayed again
through code. i.e.

Private Sub Workbook_Open()
Sheets("Sheet2").Visible = True
End Sub

If you hide the sheets on the workbook close then even if people Bypass the
code then they still will not be able to view the sheet with information on
it.
--
Kevin Smith )


"Kevin Smith" wrote:

No problems. Just be careful though because like Jacob said excel is weak in
security and no matter what you do to protect the information someone will be
able to get in if they wanted to.
--
Kevin Smith )


"Fabian" wrote:

ok, thanks for the the code snippet. It could be a solution of last-resort;
problem is that the user needs to allow the Macros (we're dealing with end
users here). And I believe that the built-in Excel protection is not totally
secure (anyone has details about this)?

But anyways, thanks for your help!

"Kevin Smith" wrote:

You are correct that they can bypass the code but if you password protect the
information then all thay will be able to do is view the data rather than
edit it. on the PC that you specify you will not need to unprotect and
protect the date because that is handled in the code.

it is something that i do with excel and access, i check the ComputerName
and User Name. if it is not me then it protects the data and if it is me then
it allows me full access.
--
Kevin Smith )


"Fabian" wrote:

Hi Kevin,

thanks for your answer!

But wouldn't it be possible for the user to not execute macros and to open
the workbook then? OK, it would be protected, but it seems not completely
safe to me.

Fabian

"Kevin Smith" wrote:

Hello,

In the "ThisWorkbook" section in the VBE you can use this code to check the
computer ID and then unprotect the spreadsheet so that it can be edited.

Private Sub Workbook_Open()
If Not Environ("ComputerName") = "YourComputerName" Then
Application.Quit
End If
ActiveSheet.Unprotect Password:="YourPassword"
End Sub

then in the same section use ...

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveSheet.Protect Password:="YourPassword", DrawingObjects:=False,
Contents:=True, Scenarios:=True
End Sub

this will password protect your spreadsheet again when you close it.
--
Kevin Smith )


"Fabian" wrote:

Hello,

I am looking for a solution to protect an Excel document to be opened on one
computer only. On other computers, the Excel document should show a message
like "This document cannot be opened on this computer" or just fail to open.

The idea is to protect intellectual property in that document (and to
prohibit its usage, so a simple cell protection wouldn't be enough).

Third party solutions would be OK too.

Any answers would be highly appreciated!

Thank you,
Fabian

  #9   Report Post  
Old September 1st 09, 05:05 PM posted to microsoft.public.excel.misc
external usenet poster
 
First recorded activity by ExcelBanter: Sep 2009
Posts: 2
Default Protect Excel Worksheet to be opened on one PC only

I have the opposite problem. I set a password for our Excel worksheets so
only the three of us who use it could get in, and only I can . . . it doesn't
even ask them for the password . . . just says "administrator set password".
Any idea what have I done wrong? We have 2003 and I used Tools, General
Options to set the password.
Thanks for any ideas.

"Fabian" wrote:

Hello,

I am looking for a solution to protect an Excel document to be opened on one
computer only. On other computers, the Excel document should show a message
like "This document cannot be opened on this computer" or just fail to open.

The idea is to protect intellectual property in that document (and to
prohibit its usage, so a simple cell protection wouldn't be enough).

Third party solutions would be OK too.

Any answers would be highly appreciated!

Thank you,
Fabian

  #10   Report Post  
Old September 1st 09, 07:16 PM posted to microsoft.public.excel.misc
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2006
Posts: 22,907
Default Protect Excel Worksheet to be opened on one PC only

You did not set a pasword for the sheets.

Where you set the password was under FileSave AsToolsGeneral Options
password to open the file(workbook)?

You do not get a password request when you open the file?


Gord Dibben MS Excel MVP

On Tue, 1 Sep 2009 09:05:01 -0700, LyndaLu
wrote:

I have the opposite problem. I set a password for our Excel worksheets so
only the three of us who use it could get in, and only I can . . . it doesn't
even ask them for the password . . . just says "administrator set password".
Any idea what have I done wrong? We have 2003 and I used Tools, General
Options to set the password.
Thanks for any ideas.

"Fabian" wrote:

Hello,

I am looking for a solution to protect an Excel document to be opened on one
computer only. On other computers, the Excel document should show a message
like "This document cannot be opened on this computer" or just fail to open.

The idea is to protect intellectual property in that document (and to
prohibit its usage, so a simple cell protection wouldn't be enough).

Third party solutions would be OK too.

Any answers would be highly appreciated!

Thank you,
Fabian




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel not displaying the last active worksheet when opened Geminist Excel Discussion (Misc queries) 0 November 22nd 06 03:31 PM
history of dates/times an excel worksheet was opened? Randy Excel Discussion (Misc queries) 0 July 18th 06 09:19 PM
lines in worksheet opened in Windows but created in Excel for Mac Jaws125 Excel Discussion (Misc queries) 3 June 23rd 06 01:15 AM
How do I protect a worksheet from being opened inside a workbook J. Robinson Excel Discussion (Misc queries) 2 June 1st 05 03:40 PM
password protect a spreadsheet to prevent it from being opened. spongebobvan Excel Worksheet Functions 2 November 23rd 04 09:12 PM


All times are GMT +1. The time now is 03:38 AM.

Powered by vBulletin® Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright 2004-2020 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"

 

Copyright © 2017