Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Protecting XLA

Hi,

I have to develop an application using VBA/EXCEL and I want to protect
as
much as possible the code. Macros are in the spreadsheet itself (just
a few like auto_open) and in a separate xla file.

Xla as far as I know can be open even if protected. can you please
advice any other way to protect it? I read somewhere that an option is
to create an .ocx. is this true? if so, does anyone know any good
reference on how to convert from XLA to OCX?

Thanks in advance

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Protecting XLA

You can protect the *.xla VBAProject with a password so's code cannot be viewed.

VBAProject passwords are a little more difficult to crack than workbook internal
passwords but as all Excel security, fairly weak.

Can't answer the OCX question.


Gord Dibben MS Excel MVP

On Wed, 14 Nov 2007 20:09:12 -0000, PA wrote:

Hi,

I have to develop an application using VBA/EXCEL and I want to protect
as
much as possible the code. Macros are in the spreadsheet itself (just
a few like auto_open) and in a separate xla file.

Xla as far as I know can be open even if protected. can you please
advice any other way to protect it? I read somewhere that an option is
to create an .ocx. is this true? if so, does anyone know any good
reference on how to convert from XLA to OCX?

Thanks in advance


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Protecting XLA

OCX, I don't think so unless you need some sort of control. Probably an
ActiveX dll which would still require VBA wrapper in a workbook (xls/xla) or
similar as a ComAddin.

Can be adapted in various languages/apps. By far the easiest and as it
happens the most secure, would be VB6. 'Easy' is a relative term, quite a
learning curve if you've not done it before. Consider Gord's suggestion of a
project password which will deter the average user.

Regards,
Peter T

"PA" wrote in message
ups.com...
Hi,

I have to develop an application using VBA/EXCEL and I want to protect
as
much as possible the code. Macros are in the spreadsheet itself (just
a few like auto_open) and in a separate xla file.

Xla as far as I know can be open even if protected. can you please
advice any other way to protect it? I read somewhere that an option is
to create an .ocx. is this true? if so, does anyone know any good
reference on how to convert from XLA to ?

Thanks in advance



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Protecting XLA

Hi

what about protecting the *.xla files through RMS? Is that possible? Like
using c#:
workbooks.open("filename.xla");
....
Add.permission(read.. or watever..?


"Peter T" wrote:

OCX, I don't think so unless you need some sort of control. Probably an
ActiveX dll which would still require VBA wrapper in a workbook (xls/xla) or
similar as a ComAddin.

Can be adapted in various languages/apps. By far the easiest and as it
happens the most secure, would be VB6. 'Easy' is a relative term, quite a
learning curve if you've not done it before. Consider Gord's suggestion of a
project password which will deter the average user.

Regards,
Peter T

"PA" wrote in message
ups.com...
Hi,

I have to develop an application using VBA/EXCEL and I want to protect
as
much as possible the code. Macros are in the spreadsheet itself (just
a few like auto_open) and in a separate xla file.

Xla as far as I know can be open even if protected. can you please
advice any other way to protect it? I read somewhere that an option is
to create an .ocx. is this true? if so, does anyone know any good
reference on how to convert from XLA to ?

Thanks in advance




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Protecting XLA

"shrutzin" wrote in message
what about protecting the *.xla files through RMS? Is that possible?


Not sure what you mean but can'imagine how that would help protect the code

Like using c#:
workbooks.open("filename.xla");
...
Add.permission(read.. or watever..?


If I follow, you are wondering about opening as ReadOnly, which indeed you
can do. But that would only prevent the file being re-saved with same name
and while opened with your code
Could save with ReadOnlyRecommended:=True but that won't help at all.

IOW, there is no way to make your VBA code fully secure, plenty of password
crackers out there.

Regards,
Peter T


"Peter T" wrote:

OCX, I don't think so unless you need some sort of control. Probably an
ActiveX dll which would still require VBA wrapper in a workbook

(xls/xla) or
similar as a ComAddin.

Can be adapted in various languages/apps. By far the easiest and as it
happens the most secure, would be VB6. 'Easy' is a relative term, quite

a
learning curve if you've not done it before. Consider Gord's suggestion

of a
project password which will deter the average user.

Regards,
Peter T

"PA" wrote in message
ups.com...
Hi,

I have to develop an application using VBA/EXCEL and I want to protect
as
much as possible the code. Macros are in the spreadsheet itself (just
a few like auto_open) and in a separate xla file.

Xla as far as I know can be open even if protected. can you please
advice any other way to protect it? I read somewhere that an option is
to create an .ocx. is this true? if so, does anyone know any good
reference on how to convert from XLA to ?

Thanks in advance








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Protecting XLA

Hi
Thanks for replying but that is not what i meant,

Like any normal workbook(.xls) can be protected using IRM (windows right
management) through code or manually also; so cant we protect an xla file
also ? so that whenever anyone opens it it will first check for user
credentials? In this way no-one will be able to see the code but can load the
xla (from tools-add-in) for the feature it wants to use.
This is much safer tahn using passwords.
I am sorry if i was not clear earlier.

"Peter T" wrote:

"shrutzin" wrote in message
what about protecting the *.xla files through RMS? Is that possible?


Not sure what you mean but can'imagine how that would help protect the code

Like using c#:
workbooks.open("filename.xla");
...
Add.permission(read.. or watever..?


If I follow, you are wondering about opening as ReadOnly, which indeed you
can do. But that would only prevent the file being re-saved with same name
and while opened with your code
Could save with ReadOnlyRecommended:=True but that won't help at all.

IOW, there is no way to make your VBA code fully secure, plenty of password
crackers out there.

Regards,
Peter T


"Peter T" wrote:

OCX, I don't think so unless you need some sort of control. Probably an
ActiveX dll which would still require VBA wrapper in a workbook

(xls/xla) or
similar as a ComAddin.

Can be adapted in various languages/apps. By far the easiest and as it
happens the most secure, would be VB6. 'Easy' is a relative term, quite

a
learning curve if you've not done it before. Consider Gord's suggestion

of a
project password which will deter the average user.

Regards,
Peter T

"PA" wrote in message
ups.com...
Hi,

I have to develop an application using VBA/EXCEL and I want to protect
as
much as possible the code. Macros are in the spreadsheet itself (just
a few like auto_open) and in a separate xla file.

Xla as far as I know can be open even if protected. can you please
advice any other way to protect it? I read somewhere that an option is
to create an .ocx. is this true? if so, does anyone know any good
reference on how to convert from XLA to ?

Thanks in advance







  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Protecting XLA

Typically VBProject (where the code is) password crackers do not even open
the file, at least not in Excel. Instead they open file as in a Hex editor,
search for certain markers, replace sections that follow that represent the
password with own known password, write the amended file back to disk
(either with new name or with same name having renamed original file as say
*.bak). When done advise you of the new password.

AFAIK, whatever rights/permissions are assigned to the file or its folder
will not prevent the above.

Regards,
Peter T

"shrutzin" wrote in message
...
Hi
Thanks for replying but that is not what i meant,

Like any normal workbook(.xls) can be protected using IRM (windows right
management) through code or manually also; so cant we protect an xla file
also ? so that whenever anyone opens it it will first check for user
credentials? In this way no-one will be able to see the code but can load

the
xla (from tools-add-in) for the feature it wants to use.
This is much safer tahn using passwords.
I am sorry if i was not clear earlier.

"Peter T" wrote:

"shrutzin" wrote in message
what about protecting the *.xla files through RMS? Is that possible?


Not sure what you mean but can'imagine how that would help protect the

code

Like using c#:
workbooks.open("filename.xla");
...
Add.permission(read.. or watever..?


If I follow, you are wondering about opening as ReadOnly, which indeed

you
can do. But that would only prevent the file being re-saved with same

name
and while opened with your code
Could save with ReadOnlyRecommended:=True but that won't help at all.

IOW, there is no way to make your VBA code fully secure, plenty of

password
crackers out there.

Regards,
Peter T


"Peter T" wrote:

OCX, I don't think so unless you need some sort of control. Probably

an
ActiveX dll which would still require VBA wrapper in a workbook

(xls/xla) or
similar as a ComAddin.

Can be adapted in various languages/apps. By far the easiest and as

it
happens the most secure, would be VB6. 'Easy' is a relative term,

quite
a
learning curve if you've not done it before. Consider Gord's

suggestion
of a
project password which will deter the average user.

Regards,
Peter T

"PA" wrote in message
ups.com...
Hi,

I have to develop an application using VBA/EXCEL and I want to

protect
as
much as possible the code. Macros are in the spreadsheet itself

(just
a few like auto_open) and in a separate xla file.

Xla as far as I know can be open even if protected. can you please
advice any other way to protect it? I read somewhere that an

option is
to create an .ocx. is this true? if so, does anyone know any good
reference on how to convert from XLA to ?

Thanks in advance









  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Protecting XLA


hi

Typically VBProject (where the code is) password crackers do not even open
the file, at least not in Excel. Instead they open file as in a Hex editor,
search for certain markers, replace sections that follow that represent the

AFAIK even if one opens a right-protected file in hex editor ; he/she will
not be able to do the above as the file is encrypted, even the content :) so
it will still be protected ...the only thing i am not sure of is how to do
this by code :)

Thanks and regards
Shrutzin

"Peter T" wrote:

Typically VBProject (where the code is) password crackers do not even open
the file, at least not in Excel. Instead they open file as in a Hex editor,
search for certain markers, replace sections that follow that represent the
password with own known password, write the amended file back to disk
(either with new name or with same name having renamed original file as say
*.bak). When done advise you of the new password.

AFAIK, whatever rights/permissions are assigned to the file or its folder
will not prevent the above.

Regards,
Peter T

"shrutzin" wrote in message
...
Hi
Thanks for replying but that is not what i meant,

Like any normal workbook(.xls) can be protected using IRM (windows right
management) through code or manually also; so cant we protect an xla file
also ? so that whenever anyone opens it it will first check for user
credentials? In this way no-one will be able to see the code but can load

the
xla (from tools-add-in) for the feature it wants to use.
This is much safer tahn using passwords.
I am sorry if i was not clear earlier.



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Protecting XLA

as the file is encrypted,
Really ?

Even if it is encrypted and/or readonly, once open in Excel user can do a
SaveAs, eg

With Workbooks("theAddin.xla")
.SaveAs "C:\temp\" & _
Replace(.Name, ".xla", "_01.xla")
End With

Regards,
Peter T


"shrutzin" wrote in message
...

hi

Typically VBProject (where the code is) password crackers do not even

open
the file, at least not in Excel. Instead they open file as in a Hex

editor,
search for certain markers, replace sections that follow that represent

the
AFAIK even if one opens a right-protected file in hex editor ; he/she will
not be able to do the above as the file is encrypted, even the content :)

so
it will still be protected ...the only thing i am not sure of is how to

do
this by code :)

Thanks and regards
Shrutzin

"Peter T" wrote:

Typically VBProject (where the code is) password crackers do not even

open
the file, at least not in Excel. Instead they open file as in a Hex

editor,
search for certain markers, replace sections that follow that represent

the
password with own known password, write the amended file back to disk
(either with new name or with same name having renamed original file as

say
*.bak). When done advise you of the new password.

AFAIK, whatever rights/permissions are assigned to the file or its

folder
will not prevent the above.

Regards,
Peter T

"shrutzin" wrote in message
...
Hi
Thanks for replying but that is not what i meant,

Like any normal workbook(.xls) can be protected using IRM (windows

right
management) through code or manually also; so cant we protect an xla

file
also ? so that whenever anyone opens it it will first check for user
credentials? In this way no-one will be able to see the code but can

load
the
xla (from tools-add-in) for the feature it wants to use.
This is much safer tahn using passwords.
I am sorry if i was not clear earlier.





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
protecting formulas without protecting sheet so grouping still wor JM Excel Discussion (Misc queries) 1 June 4th 09 06:42 AM
Protecting VB Darin Kramer Excel Programming 1 February 15th 07 03:50 PM
protecting... Mon Excel Discussion (Misc queries) 2 December 8th 05 07:59 PM
Protecting buttons with VB code rather than protecting sheets/books? StargateFanFromWork Excel Programming 2 July 16th 04 04:03 PM
protecting a csv file lothario[_46_] Excel Programming 1 November 7th 03 12:27 AM


All times are GMT +1. The time now is 01:28 AM.

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

About Us

"It's about Microsoft Excel"