The Code Cage - Microsoft Office help Free Microsoft Office Help for all Applications!  

To stop seeing these ads and get other benefits check This page!

Go Back   The Code Cage Forums > Newsgroups - Microsoft Topics > Newsgroup - Excel Forum > Excel VBA Programming
  Microsoft Office Chat Online now!


Excel VBA Programming Post questions in this forum if they are related to using Microsoft Excel VBA Programming, Macro's etc.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 8th June 2009, 03:12 PM
Mia
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Chats:
Default Autostart macro-protect file

------ Register to get rid of these "In Post" ads! ------


Hi,

I have written following code to protect my file from
beeing used from people who shouldent use it. The problem
I have is that you have to activate the macro when you
open the file to get it started, so it don't totaly work.
'Original Source: The Code Cage Forums http://www.thecodecage.com/forumz/excel-vba-programming/104493-autostart-macro-protect-file.html#post373311
Do anyone know howe to solv this?

Private Sub Workbook_Open()
If Application.OrganizationName = "Min pc" Then

MsgBox "Hej " & Application.UserName

Else

Application.Quit

End If
End Sub
--

I would be wery grateful for yout help!
Best regards
Mia
Reply to this post


Did you find this post helpful? Yes | No

The Code Cage Advertisment
Advertisement

To stop seeing these ads and get other benefits check This page!
  #2 (permalink)  
Old 8th June 2009, 03:51 PM
Dave Peterson
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Chats:
Default Re: Autostart macro-protect file

------ Register to get rid of these "In Post" ads! ------


The only effective way to keep people out of your workbook is to not share it
with them.

Anything that depends on a macro means that macros can be disabled--and it's not
too difficult to break into your code and just turn off the things that do the
checking.

You could give the workbook a nice password to open and only share the password
with trusted co-workers, but even those can be broken.

Mia wrote:
>
> Hi,
>
> I have written following code to protect my file from
> beeing used from people who shouldent use it. The problem
> I have is that you have to activate the macro when you
> open the file to get it started, so it don't totaly work.
> Do anyone know howe to solv this?
>
> Private Sub Workbook_Open()
> If Application.OrganizationName = "Min pc" Then
'Original Source: The Code Cage Forums http://www.thecodecage.com/forumz/excel-vba-programming/104493-autostart-macro-protect-file.html#post373370
>
> MsgBox "Hej " & Application.UserName
>
> Else
>
> Application.Quit
>
> End If
> End Sub
> --
>
> I would be wery grateful for yout help!
> Best regards
> Mia


--

Dave Peterson
Reply to this post


Did you find this post helpful? Yes | No
  #3 (permalink)  
Old 8th June 2009, 04:19 PM
Mia
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Chats:
Default Re: Autostart macro-protect file

------ Register to get rid of these "In Post" ads! ------


Hi Dave,

I know that I can´t protect the files totaly.
Anyone as you say that are good i excel can open them,
but I want to protect them from "a normal" user.
I have some wery critical information regarding our
business that I don´t want to be spread outside our firm?

Do you know any way to do this automatic, for
example with a macro? If I can chose I dont
want a password.

--
Best regards
Mia


"Dave Peterson" skrev:

> The only effective way to keep people out of your workbook is to not share it
> with them.
>
> Anything that depends on a macro means that macros can be disabled--and it's not
> too difficult to break into your code and just turn off the things that do the
> checking.
>
> You could give the workbook a nice password to open and only share the password
'Original Source: The Code Cage Forums http://www.thecodecage.com/forumz/excel-vba-programming/104493-autostart-macro-protect-file.html#post373430
> with trusted co-workers, but even those can be broken.
>
> Mia wrote:
> >
> > Hi,
> >
> > I have written following code to protect my file from
> > beeing used from people who shouldent use it. The problem
> > I have is that you have to activate the macro when you
> > open the file to get it started, so it don't totaly work.
> > Do anyone know howe to solv this?
> >
> > Private Sub Workbook_Open()
> > If Application.OrganizationName = "Min pc" Then
> >
> > MsgBox "Hej " & Application.UserName
> >
> > Else
> >
> > Application.Quit
> >
> > End If
> > End Sub
> > --
> >
> > I would be wery grateful for yout help!
> > Best regards
> > Mia

>
> --
>
> Dave Peterson
>

Reply to this post


Did you find this post helpful? Yes | No
The Code Cage Advertisment
Advertisement

To stop seeing these ads and get other benefits check This page!
  #4 (permalink)  
Old 8th June 2009, 08:46 PM
Dave Peterson
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Chats:
Default Re: Autostart macro-protect file

------ Register to get rid of these "In Post" ads! ------


You seem to know how to do it with a macro, but you also know that if macros are
disabled, then this won't work.

Harlan Grove recommended that you add a UDF (user defined function) that is
essentially a do nothing function. But if macros are disabled, then the UDF
will fail.

Then you include this function in very important formulas.

Option Explicit
'Original Source: The Code Cage Forums http://www.thecodecage.com/forumz/excel-vba-programming/104493-autostart-macro-protect-file.html#post373889
Function iFunc() As Long
iFunc = 1
End Function


Then in an important/complex formula that returns a number:

=if(...)*someotherformula*ifunc()

If macros are disabled (and depending on the version of excel that the user is
using -- and the user hasn't changed any register settings!), then when the file
is opened with macros disabled, the function will return a #NAME? error.

If you do it in enough spots (and all that other stuff is still true), then you
may stop the user from being able to do anything with your workbook.


Mia wrote:
>
> Hi Dave,
>
> I know that I can´t protect the files totaly.
> Anyone as you say that are good i excel can open them,
> but I want to protect them from "a normal" user.
> I have some wery critical information regarding our
> business that I don´t want to be spread outside our firm?
>
> Do you know any way to do this automatic, for
> example with a macro? If I can chose I dont
> want a password.
>
> --
> Best regards
> Mia
>
> "Dave Peterson" skrev:
>
> > The only effective way to keep people out of your workbook is to not share it
> > with them.
> >
> > Anything that depends on a macro means that macros can be disabled--and it's not
> > too difficult to break into your code and just turn off the things that do the
> > checking.
> >
> > You could give the workbook a nice password to open and only share the password
> > with trusted co-workers, but even those can be broken.
> >
> > Mia wrote:
> > >
> > > Hi,
> > >
> > > I have written following code to protect my file from
> > > beeing used from people who shouldent use it. The problem
> > > I have is that you have to activate the macro when you
> > > open the file to get it started, so it don't totaly work.
> > > Do anyone know howe to solv this?
> > >
> > > Private Sub Workbook_Open()
> > > If Application.OrganizationName = "Min pc" Then
> > >
> > > MsgBox "Hej " & Application.UserName
> > >
> > > Else
> > >
> > > Application.Quit
> > >
> > > End If
> > > End Sub
> > > --
> > >
> > > I would be wery grateful for yout help!
> > > Best regards
> > > Mia

> >
> > --
> >
> > Dave Peterson
> >


--

Dave Peterson
Reply to this post


Did you find this post helpful? Yes | No
  #5 (permalink)  
Old 8th June 2009, 10:15 PM
Mia
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Chats:
Default Re: Autostart macro-protect file

------ Register to get rid of these "In Post" ads! ------


Hello again,

You are right, I know how to do it with a macro and I know that if macros are
disabled, then this won't work.

I tried your formula bu I don´t get it right ( I´m not so god at this as you
are).
If I have my macro like this, how do I write to get it to work?

Private Sub Workbook_Open()
If Application.OrganizationName = "Min pc" Then

MsgBox "Hej " & Application.UserName

Else

'Original Source: The Code Cage Forums http://www.thecodecage.com/forumz/excel-vba-programming/104493-autostart-macro-protect-file.html#post374011
Application.Quit

End If
End Sub

Do I have to write a complete new macro and where do I put it?

Thank you for your time!

--
Best regards
Mia


"Dave Peterson" skrev:

> You seem to know how to do it with a macro, but you also know that if macros are
> disabled, then this won't work.
>
> Harlan Grove recommended that you add a UDF (user defined function) that is
> essentially a do nothing function. But if macros are disabled, then the UDF
> will fail.
>
> Then you include this function in very important formulas.
>
> Option Explicit
> Function iFunc() As Long
> iFunc = 1
> End Function
>
>
> Then in an important/complex formula that returns a number:
>
> =if(...)*someotherformula*ifunc()
>
> If macros are disabled (and depending on the version of excel that the user is
> using -- and the user hasn't changed any register settings!), then when the file
> is opened with macros disabled, the function will return a #NAME? error.
>
> If you do it in enough spots (and all that other stuff is still true), then you
> may stop the user from being able to do anything with your workbook.
>
>
> Mia wrote:
> >
> > Hi Dave,
> >
> > I know that I can´t protect the files totaly.
> > Anyone as you say that are good i excel can open them,
> > but I want to protect them from "a normal" user.
> > I have some wery critical information regarding our
> > business that I don´t want to be spread outside our firm?
> >
> > Do you know any way to do this automatic, for
> > example with a macro? If I can chose I dont
> > want a password.
> >
> > --
> > Best regards
> > Mia
> >
> > "Dave Peterson" skrev:
> >
> > > The only effective way to keep people out of your workbook is to not share it
> > > with them.
> > >
> > > Anything that depends on a macro means that macros can be disabled--and it's not
> > > too difficult to break into your code and just turn off the things that do the
> > > checking.
> > >
> > > You could give the workbook a nice password to open and only share the password
> > > with trusted co-workers, but even those can be broken.
> > >
> > > Mia wrote:
> > > >
> > > > Hi,
> > > >
> > > > I have written following code to protect my file from
> > > > beeing used from people who shouldent use it. The problem
> > > > I have is that you have to activate the macro when you
> > > > open the file to get it started, so it don't totaly work.
> > > > Do anyone know howe to solv this?
> > > >
> > > > Private Sub Workbook_Open()
> > > > If Application.OrganizationName = "Min pc" Then
> > > >
> > > > MsgBox "Hej " & Application.UserName
> > > >
> > > > Else
> > > >
> > > > Application.Quit
> > > >
> > > > End If
> > > > End Sub
> > > > --
> > > >
> > > > I would be wery grateful for yout help!
> > > > Best regards
> > > > Mia
> > >
> > > --
> > >
> > > Dave Peterson
> > >

>
> --
>
> Dave Peterson
>

Reply to this post


Did you find this post helpful? Yes | No
  #6 (permalink)  
Old 8th June 2009, 10:42 PM
Dave Peterson
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Chats:
Default Re: Autostart macro-protect file

------ Register to get rid of these "In Post" ads! ------


The code looks ok to me, but you have to make sure it's in the right spot.
'Original Source: The Code Cage Forums http://www.thecodecage.com/forumz/excel-vba-programming/104493-autostart-macro-protect-file.html#post374044

Open the VBE and make sure that code is under the ThisWorkbook module--not
anywhere else.

Then close excel (saving the test workbook) and reopen it with macros enabled to
test.

On the other hand, the UDF that I suggested before goes in a regular module
(insert|Module from within the VBE).

And at the same time, you'll need to make some changes to existing formulas that
return numbers:

=a1*31.323+b9*iFunc()

If you're new to macros:

Debra Dalgleish has some notes how to implement macros here:
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

Mia wrote:
>
> Hello again,
>
> You are right, I know how to do it with a macro and I know that if macros are
> disabled, then this won't work.
>
> I tried your formula bu I don´t get it right ( I´m not so god at this as you
> are).
> If I have my macro like this, how do I write to get it to work?
>
> Private Sub Workbook_Open()
> If Application.OrganizationName = "Min pc" Then
>
> MsgBox "Hej " & Application.UserName
>
> Else
>
> Application.Quit
>
> End If
> End Sub
>
> Do I have to write a complete new macro and where do I put it?
>
> Thank you for your time!
>
> --
> Best regards
> Mia
>
> "Dave Peterson" skrev:
>
> > You seem to know how to do it with a macro, but you also know that if macros are
> > disabled, then this won't work.
> >
> > Harlan Grove recommended that you add a UDF (user defined function) that is
> > essentially a do nothing function. But if macros are disabled, then the UDF
> > will fail.
> >
> > Then you include this function in very important formulas.
> >
> > Option Explicit
> > Function iFunc() As Long
> > iFunc = 1
> > End Function
> >
> >
> > Then in an important/complex formula that returns a number:
> >
> > =if(...)*someotherformula*ifunc()
> >
> > If macros are disabled (and depending on the version of excel that the user is
> > using -- and the user hasn't changed any register settings!), then when the file
> > is opened with macros disabled, the function will return a #NAME? error.
> >
> > If you do it in enough spots (and all that other stuff is still true), then you
> > may stop the user from being able to do anything with your workbook.
> >
> >
> > Mia wrote:
> > >
> > > Hi Dave,
> > >
> > > I know that I can´t protect the files totaly.
> > > Anyone as you say that are good i excel can open them,
> > > but I want to protect them from "a normal" user.
> > > I have some wery critical information regarding our
> > > business that I don´t want to be spread outside our firm?
> > >
> > > Do you know any way to do this automatic, for
> > > example with a macro? If I can chose I dont
> > > want a password.
> > >
> > > --
> > > Best regards
> > > Mia
> > >
> > > "Dave Peterson" skrev:
> > >
> > > > The only effective way to keep people out of your workbook is to not share it
> > > > with them.
> > > >
> > > > Anything that depends on a macro means that macros can be disabled--and it's not
> > > > too difficult to break into your code and just turn off the things that do the
> > > > checking.
> > > >
> > > > You could give the workbook a nice password to open and only share the password
> > > > with trusted co-workers, but even those can be broken.
> > > >
> > > > Mia wrote:
> > > > >
> > > > > Hi,
> > > > >
> > > > > I have written following code to protect my file from
> > > > > beeing used from people who shouldent use it. The problem
> > > > > I have is that you have to activate the macro when you
> > > > > open the file to get it started, so it don't totaly work.
> > > > > Do anyone know howe to solv this?
> > > > >
> > > > > Private Sub Workbook_Open()
> > > > > If Application.OrganizationName = "Min pc" Then
> > > > >
> > > > > MsgBox "Hej " & Application.UserName
> > > > >
> > > > > Else
> > > > >
> > > > > Application.Quit
> > > > >
> > > > > End If
> > > > > End Sub
> > > > > --
> > > > >
> > > > > I would be wery grateful for yout help!
> > > > > Best regards
> > > > > Mia
> > > >
> > > > --
> > > >
> > > > Dave Peterson
> > > >

> >
> > --
> >
> > Dave Peterson
> >


--

Dave Peterson
Reply to this post


Did you find this post helpful? Yes | No
The Code Cage Advertisment
Advertisement

To stop seeing these ads and get other benefits check This page!
  #7 (permalink)  
Old 9th June 2009, 03:35 AM
ryguy7272
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Chats:
Default Re: Autostart macro-protect file

------ Register to get rid of these "In Post" ads! ------


There is no way to be 100% certain that your work can’t be
hacked, stolen, etc. However, I’ve found that the following combination
(both #1 & #2 together) offers pretty good protection:

#1) Tools > Protection > Protect Sheet (or Protect Workbook), then enter a
Password.
#2) Tools > Share Workbook > Allow Changes.

If you really want to protect your data from users, you may be much better
off using Access for your app. Access security can be disabled as well, but
it is harder to do so.


Good luck,
Ryan---


--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Dave Peterson" wrote:

> The code looks ok to me, but you have to make sure it's in the right spot.
>
> Open the VBE and make sure that code is under the ThisWorkbook module--not
> anywhere else.
>
> Then close excel (saving the test workbook) and reopen it with macros enabled to
> test.
>
> On the other hand, the UDF that I suggested before goes in a regular module
> (insert|Module from within the VBE).
>
> And at the same time, you'll need to make some changes to existing formulas that
> return numbers:
>
> =a1*31.323+b9*iFunc()
>
> If you're new to macros:
>
> Debra Dalgleish has some notes how to implement macros here:
> http://www.contextures.com/xlvba01.html
>
> David McRitchie has an intro to macros:
> http://www.mvps.org/dmcritchie/excel/getstarted.htm
>
> Ron de Bruin's intro to macros:
> http://www.rondebruin.nl/code.htm
>
> (General, Regular and Standard modules all describe the same thing.)
>
> Mia wrote:
> >
> > Hello again,
> >
> > You are right, I know how to do it with a macro and I know that if macros are
> > disabled, then this won't work.
> >
> > I tried your formula bu I don´t get it right ( I´m not so god at this as you
> > are).
> > If I have my macro like this, how do I write to get it to work?
> >
> > Private Sub Workbook_Open()
> > If Application.OrganizationName = "Min pc" Then
> >
> > MsgBox "Hej " & Application.UserName
> >
> > Else
> >
> > Application.Quit
> >
> > End If
> > End Sub
> >
> > Do I have to write a complete new macro and where do I put it?
> >
> > Thank you for your time!
> >
> > --
> > Best regards
> > Mia
> >
> > "Dave Peterson" skrev:
> >
> > > You seem to know how to do it with a macro, but you also know that if macros are
> > > disabled, then this won't work.
> > >
> > > Harlan Grove recommended that you add a UDF (user defined function) that is
> > > essentially a do nothing function. But if macros are disabled, then the UDF
> > > will fail.
> > >
> > > Then you include this function in very important formulas.
> > >
> > > Option Explicit
> > > Function iFunc() As Long
> > > iFunc = 1
> > > End Function
> > >
> > >
> > > Then in an important/complex formula that returns a number:
> > >
> > > =if(...)*someotherformula*ifunc()
> > >
> > > If macros are disabled (and depending on the version of excel that the user is
> > > using -- and the user hasn't changed any register settings!), then when the file
> > > is opened with macros disabled, the function will return a #NAME? error.
> > >
> > > If you do it in enough spots (and all that other stuff is still true), then you
> > > may stop the user from being able to do anything with your workbook.
> > >
> > >
> > > Mia wrote:
> > > >
> > > > Hi Dave,
> > > >
> > > > I know that I can´t protect the files totaly.
> > > > Anyone as you say that are good i excel can open them,
> > > > but I want to protect them from "a normal" user.
> > > > I have some wery critical information regarding our
> > > > business that I don´t want to be spread outside our firm?
> > > >
> > > > Do you know any way to do this automatic, for
> > > > example with a macro? If I can chose I dont
> > > > want a password.
> > > >
> > > > --
> > > > Best regards
> > > > Mia
> > > >
> > > > "Dave Peterson" skrev:
> > > >
> > > > > The only effective way to keep people out of your workbook is to not share it
> > > > > with them.
> > > > >
> > > > > Anything that depends on a macro means that macros can be disabled--and it's not
> > > > > too difficult to break into your code and just turn off the things that do the
> > > > > checking.
> > > > >
> > > > > You could give the workbook a nice password to open and only share the password
> > > > > with trusted co-workers, but even those can be broken.
> > > > >
> > > > > Mia wrote:
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > I have written following code to protect my file from
> > > > > > beeing used from people who shouldent use it. The problem
> > > > > > I have is that you have to activate the macro when you
> > > > > > open the file to get it started, so it don't totaly work.
> > > > > > Do anyone know howe to solv this?
> > > > > >
> > > > > > Private Sub Workbook_Open()
> > > > > > If Application.OrganizationName = "Min pc" Then
> > > > > >
> > > > > > MsgBox "Hej " & Application.UserName
> > > > > >
> > > > > > Else
> > > > > >
> > > > > > Application.Quit
> > > > > >
> > > > > > End If
> > > > > > End Sub
> > > > > > --
> > > > > >
> > > > > > I would be wery grateful for yout help!
> > > > > > Best regards
'Original Source: The Code Cage Forums http://www.thecodecage.com/forumz/excel-vba-programming/104493-autostart-macro-protect-file.html#post374250
> > > > > > Mia
> > > > >
> > > > > --
> > > > >
> > > > > Dave Peterson
> > > > >
> > >
> > > --
> > >
> > > Dave Peterson
> > >

>
> --
>
> Dave Peterson
>

Reply to this post


Did you find this post helpful? Yes | No
  #8 (permalink)  
Old 9th June 2009, 01:26 PM
Dave Peterson
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Chats:
Default Re: Autostart macro-protect file

------ Register to get rid of these "In Post" ads! ------


#1. This kind of worksheet and workbook protection is really simple to break.
I wouldn't trust it at all.

#2. I don't understand how sharing a workbook would add any level of
protection. And there are so many features that are unavailable when the
workbook is shared, that many don't use it (and others avoid it because of its
reputation of corrupting workbooks).



ryguy7272 wrote:
>
> There is no way to be 100% certain that your work can’t be
> hacked, stolen, etc. However, I’ve found that the following combination
> (both #1 & #2 together) offers pretty good protection:
>
> #1) Tools > Protection > Protect Sheet (or Protect Workbook), then enter a
> Password.
> #2) Tools > Share Workbook > Allow Changes.
>
> If you really want to protect your data from users, you may be much better
> off using Access for your app. Access security can be disabled as well, but
> it is harder to do so.
>
> Good luck,
> Ryan---
>
> --
> Ryan---
> If this information was helpful, please indicate this by clicking ''Yes''.
>
> "Dave Peterson" wrote:
>
> > The code looks ok to me, but you have to make sure it's in the right spot.
> >
> > Open the VBE and make sure that code is under the ThisWorkbook module--not
> > anywhere else.
> >
> > Then close excel (saving the test workbook) and reopen it with macros enabled to
> > test.
> >
> > On the other hand, the UDF that I suggested before goes in a regular module
> > (insert|Module from within the VBE).
> >
> > And at the same time, you'll need to make some changes to existing formulas that
> > return numbers:
> >
> > =a1*31.323+b9*iFunc()
> >
> > If you're new to macros:
> >
> > Debra Dalgleish has some notes how to implement macros here:
> > http://www.contextures.com/xlvba01.html
> >
> > David McRitchie has an intro to macros:
> > http://www.mvps.org/dmcritchie/excel/getstarted.htm
> >
> > Ron de Bruin's intro to macros:
> > http://www.rondebruin.nl/code.htm
> >
> > (General, Regular and Standard modules all describe the same thing.)
> >
> > Mia wrote:
> > >
> > > Hello again,
> > >
> > > You are right, I know how to do it with a macro and I know that if macros are
> > > disabled, then this won't work.
> > >
> > > I tried your formula bu I don´t get it right ( I´m not so god at this as you
> > > are).
> > > If I have my macro like this, how do I write to get it to work?
> > >
> > > Private Sub Workbook_Open()
> > > If Application.OrganizationName = "Min pc" Then
> > >
> > > MsgBox "Hej " & Application.UserName
> > >
> > > Else
> > >
> > > Application.Quit
> > >
> > > End If
> > > End Sub
> > >
> > > Do I have to write a complete new macro and where do I put it?
> > >
> > > Thank you for your time!
> > >
> > > --
> > > Best regards
> > > Mia
> > >
> > > "Dave Peterson" skrev:
> > >
> > > > You seem to know how to do it with a macro, but you also know that if macros are
> > > > disabled, then this won't work.
> > > >
> > > > Harlan Grove recommended that you add a UDF (user defined function) that is
> > > > essentially a do nothing function. But if macros are disabled, then the UDF
> > > > will fail.
> > > >
> > > > Then you include this function in very important formulas.
> > > >
> > > > Option Explicit
> > > > Function iFunc() As Long
> > > > iFunc = 1
> > > > End Function
> > > >
> > > >
> > > > Then in an important/complex formula that returns a number:
> > > >
> > > > =if(...)*someotherformula*ifunc()
> > > >
> > > > If macros are disabled (and depending on the version of excel that the user is
> > > > using -- and the user hasn't changed any register settings!), then when the file
> > > > is opened with macros disabled, the function will return a #NAME? error.
> > > >
> > > > If you do it in enough spots (and all that other stuff is still true), then you
> > > > may stop the user from being able to do anything with your workbook.
> > > >
> > > >
> > > > Mia wrote:
> > > > >
> > > > > Hi Dave,
> > > > >
> > > > > I know that I can´t protect the files totaly.
> > > > > Anyone as you say that are good i excel can open them,
> > > > > but I want to protect them from "a normal" user.
> > > > > I have some wery critical information regarding our
> > > > > business that I don´t want to be spread outside our firm?
> > > > >
> > > > > Do you know any way to do this automatic, for
> > > > > example with a macro? If I can chose I dont
> > > > > want a password.
> > > > >
> > > > > --
> > > > > Best regards
> > > > > Mia
> > > > >
> > > > > "Dave Peterson" skrev:
> > > > >
> > > > > > The only effective way to keep people out of your workbook is to not share it
> > > > > > with them.
> > > > > >
> > > > > > Anything that depends on a macro means that macros can be disabled--and it's not
'Original Source: The Code Cage Forums http://www.thecodecage.com/forumz/excel-vba-programming/104493-autostart-macro-protect-file.html#post374562
> > > > > > too difficult to break into your code and just turn off the things that do the
> > > > > > checking.
> > > > > >
> > > > > > You could give the workbook a nice password to open and only share the password
> > > > > > with trusted co-workers, but even those can be broken.
> > > > > >
> > > > > > Mia wrote:
> > > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > I have written following code to protect my file from
> > > > > > > beeing used from people who shouldent use it. The problem
> > > > > > > I have is that you have to activate the macro when you
> > > > > > > open the file to get it started, so it don't totaly work.
> > > > > > > Do anyone know howe to solv this?
> > > > > > >
> > > > > > > Private Sub Workbook_Open()
> > > > > > > If Application.OrganizationName = "Min pc" Then
> > > > > > >
> > > > > > > MsgBox "Hej " & Application.UserName
> > > > > > >
> > > > > > > Else
> > > > > > >
> > > > > > > Application.Quit
> > > > > > >
> > > > > > > End If
> > > > > > > End Sub
> > > > > > > --
> > > > > > >
> > > > > > > I would be wery grateful for yout help!
> > > > > > > Best regards
> > > > > > > Mia
> > > > > >
> > > > > > --
> > > > > >
> > > > > > Dave Peterson
> > > > > >
> > > >
> > > > --
> > > >
> > > > Dave Peterson
> > > >

> >
> > --
> >
> > Dave Peterson
> >


--

Dave Peterson
Reply to this post


Did you find this post helpful? Yes | No
The Code Cage Advertisment
Advertisement

To stop seeing these ads and get other benefits check This page!
Reply

Bookmarks

Tags
autostart, file, macroprotect


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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

Forum Jump

The Code Cage Affilliates


To stop seeing these ads and get other benefits check This page!



All times are GMT +1. The time now is 08:15 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2
No part of this board may be copied or reproduced either in part or full without the express permission of The Code Cage Team.
We are not associated with nor employed by Microsoft in any way, we simply provide resources!
All MS office icons are registered trademarks of the application the represent