Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / November 2007

Tip: Looking for answers? Try searching our database.

Protecting XLA

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
PA - 14 Nov 2007 20:09 GMT
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
Gord Dibben - 14 Nov 2007 21:39 GMT
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

>Hi,
>
[quoted text clipped - 9 lines]
>
>Thanks in advance
Peter T - 15 Nov 2007 00:18 GMT
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

> Hi,
>
[quoted text clipped - 9 lines]
>
> Thanks in advance
shrutzin - 19 Nov 2007 08:41 GMT
Hi

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

> 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
[quoted text clipped - 21 lines]
> >
> > Thanks in advance
Peter T - 19 Nov 2007 09:41 GMT
"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

> > 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
[quoted text clipped - 21 lines]
> > >
> > > Thanks in advance
shrutzin - 19 Nov 2007 10:16 GMT
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.

> "shrutzin" wrote in message
> > what about protecting the *.xla files through RMS? Is that possible?
[quoted text clipped - 45 lines]
> > > >
> > > > Thanks in advance
Peter T - 19 Nov 2007 11:03 GMT
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

> Hi
> Thanks for replying but that is not what i meant,
[quoted text clipped - 56 lines]
> > > > >
> > > > > Thanks in advance
shrutzin - 19 Nov 2007 11:49 GMT
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

> 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,
[quoted text clipped - 20 lines]
> > This is much safer tahn using passwords.
> > I am sorry if i was not clear earlier.
Peter T - 19 Nov 2007 12:14 GMT
>  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

> hi
>
[quoted text clipped - 33 lines]
> > > This is much safer tahn using passwords.
> > > I am sorry if i was not clear earlier.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.