View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Howard Kaikow Howard Kaikow is offline
external usenet poster
 
Posts: 269
Default Setting VBA Project Password

"keepITcool" wrote in message
ft.com...

agreed..
in your scenario of creating a new workbook it's not a problem.
in other scenarios it could be.. hence flaw not bug <G


It is only a flaw if it was dome unintentionally.

In other forums I describe the purposes of my task.

I have developed a VB 6 EXE to totally create a Word template from scratch,
including setting a password, reference, etc. There is no option for the
user to set the password, the password is set by the code and the use is not
informed of the password.

There are other issue to increase the security, e.g., running the code
without displaying the dialog. I won't discuss those as they affect
security.

Note that it is only necessary to display the dialog momentarily to get the
handle, after that the dialog need not be visible.

Of course, the setting of a VBA password in code is almost a pointless
exercise, as it is all too easy to bypass the password.

The challenge was to do the deed without using SendKeys, as those techniques
can be applied at other times in useful scenarios. The biggest obstacle was
MSFT's poor documentation.

It's been a while since I moved the code to VBA, as I have no intention of
using such code other than in VB 6.
I did not need a hook or a timer.

My recollection is that if you take the code exactly as I wrote it, the code
should work in each Office app with no change other than specifying the path
to which to write the file.

Also, I am creating a new project, not applying a password to an extant
project.

I've spent so much time on this issue recently, I do not really want to
discuss the topic further.

re Spy++
have you ever tried WinSpector Spy? I think it's got a "few" advantages
over Spy++ http://www.windows-spy.com/
(check out the windows class watch ..)


Never tried it.