PC Review


Reply
Thread Tools Rate Thread

automating (alt & f11)

 
 
pswanie
Guest
Posts: n/a
 
      20th Jan 2008
my previous posting was not clear i think...

what can i add to a command so that when i click it, it checks that textbox1
got "mypass" and then run the sub

i have a textbox on a userform and a commandbutton1.
the aplication (excell workbook) is set to visible = valse

click commandbutton1 go and check if textbox1 contain "mypass"
commandbutton1 make the application visible = true and unload userform1.

then i can get to my macros etc..
i got this.


Private Sub CommandButton5_Click()


Application.Visible = True
Unload UserForm1


End Sub


 
Reply With Quote
 
 
 
 
Per Jessen
Guest
Posts: n/a
 
      20th Jan 2008
I think this is what you need.

Private Sub CommandButton5_Click()

If Me.textbox1.Value = "mypass" Then
Application.Visible = True
Unload UserForm1
End If

End Sub

//Per

"pswanie" <(E-Mail Removed)> skrev i en meddelelse
news:8F7B5254-769E-40C8-BB39-(E-Mail Removed)...
> my previous posting was not clear i think...
>
> what can i add to a command so that when i click it, it checks that
> textbox1
> got "mypass" and then run the sub
>
> i have a textbox on a userform and a commandbutton1.
> the aplication (excell workbook) is set to visible = valse
>
> click commandbutton1 go and check if textbox1 contain "mypass"
> commandbutton1 make the application visible = true and unload userform1.
>
> then i can get to my macros etc..
> i got this.
>
>
> Private Sub CommandButton5_Click()
>
>
> Application.Visible = True
> Unload UserForm1
>
>
> End Sub
>
>



 
Reply With Quote
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      20th Jan 2008
Try this...

Private Sub CommandButton5_Click()
If TextBox1.Text = "mypass" Then
Application.Visible = True
Unload UserForm1
End If
End Sub

If you are doing what I think you are doing, you should know (at least I'm
pretty sure that) your password will be embedded in the saved workbook as
plain text; viewable with a plain text editor like Notepad. True, someone
would have to know where to look, but it might be easy to locate. You might
want to encrypt it a little bit to make it harder to find. One way, perhaps,
would be to mix it in between other characters (maybe locating each letter
as the 3rd character in a much bigger string of characters) and run a loop
to pick them out.

Rick


"pswanie" <(E-Mail Removed)> wrote in message
news:8F7B5254-769E-40C8-BB39-(E-Mail Removed)...
> my previous posting was not clear i think...
>
> what can i add to a command so that when i click it, it checks that
> textbox1
> got "mypass" and then run the sub
>
> i have a textbox on a userform and a commandbutton1.
> the aplication (excell workbook) is set to visible = valse
>
> click commandbutton1 go and check if textbox1 contain "mypass"
> commandbutton1 make the application visible = true and unload userform1.
>
> then i can get to my macros etc..
> i got this.
>
>
> Private Sub CommandButton5_Click()
>
>
> Application.Visible = True
> Unload UserForm1
>
>
> End Sub
>
>


 
Reply With Quote
 
pswanie
Guest
Posts: n/a
 
      20th Jan 2008
great idea.... jip im aware that its easy to crack that..

how would i go about to use that loop idea?





"Rick Rothstein (MVP - VB)" wrote:

> Try this...
>
> Private Sub CommandButton5_Click()
> If TextBox1.Text = "mypass" Then
> Application.Visible = True
> Unload UserForm1
> End If
> End Sub
>
> If you are doing what I think you are doing, you should know (at least I'm
> pretty sure that) your password will be embedded in the saved workbook as
> plain text; viewable with a plain text editor like Notepad. True, someone
> would have to know where to look, but it might be easy to locate. You might
> want to encrypt it a little bit to make it harder to find. One way, perhaps,
> would be to mix it in between other characters (maybe locating each letter
> as the 3rd character in a much bigger string of characters) and run a loop
> to pick them out.
>
> Rick
>
>
> "pswanie" <(E-Mail Removed)> wrote in message
> news:8F7B5254-769E-40C8-BB39-(E-Mail Removed)...
> > my previous posting was not clear i think...
> >
> > what can i add to a command so that when i click it, it checks that
> > textbox1
> > got "mypass" and then run the sub
> >
> > i have a textbox on a userform and a commandbutton1.
> > the aplication (excell workbook) is set to visible = valse
> >
> > click commandbutton1 go and check if textbox1 contain "mypass"
> > commandbutton1 make the application visible = true and unload userform1.
> >
> > then i can get to my macros etc..
> > i got this.
> >
> >
> > Private Sub CommandButton5_Click()
> >
> >
> > Application.Visible = True
> > Unload UserForm1
> >
> >
> > End Sub
> >
> >

>
>

 
Reply With Quote
 
pswanie
Guest
Posts: n/a
 
      20th Jan 2008
i needed to add that when userform unload and application vissible hapens.
would it be possible to automate the alt & F11 keystroke?




"pswanie" wrote:

> my previous posting was not clear i think...
>
> what can i add to a command so that when i click it, it checks that textbox1
> got "mypass" and then run the sub
>
> i have a textbox on a userform and a commandbutton1.
> the aplication (excell workbook) is set to visible = valse
>
> click commandbutton1 go and check if textbox1 contain "mypass"
> commandbutton1 make the application visible = true and unload userform1.
>
> then i can get to my macros etc..
> i got this.
>
>
> Private Sub CommandButton5_Click()
>
>
> Application.Visible = True
> Unload UserForm1
>
>
> End Sub
>
>

 
Reply With Quote
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      20th Jan 2008
Try this (the password is still mypass)...

Private Sub CommandButton5_Click()
Dim X As Long
Dim PW As String
Const HiddenPassword = "@32m )#yeX*p p!a64bs ##sdf2"
For X = 4 To Len(HiddenPassword) Step 4
PW = PW & Mid(HiddenPassword, X, 1)
Next
If TextBox1.Text = PW Then
Application.Visible = True
Unload UserForm1
End If
End Sub

You can change the starting spot in for you password in the HiddenPassword
constant, and also vary the number of characters between the letters of your
password, you just have to adjust the starting point and Step values in the
For-Next loop. This way, if someone looks, they will only see @32m )#yeX*p
p!a64bs ##sdf2 and not your actual password. Of course, this is an extremely
simple encryption scheme, but it should suffice for normal situations. Note
that if you use a regular word or phrase, it might still be discoverable by
"prying eyes", but if you mix punctuation marks into your "real" password,
it should be harder to find in random mix of letters.

Rick


"pswanie" <(E-Mail Removed)> wrote in message
news:E6E919FE-164E-4DD7-8458-(E-Mail Removed)...
> great idea.... jip im aware that its easy to crack that..
>
> how would i go about to use that loop idea?
>
>
>
>
>
> "Rick Rothstein (MVP - VB)" wrote:
>
>> Try this...
>>
>> Private Sub CommandButton5_Click()
>> If TextBox1.Text = "mypass" Then
>> Application.Visible = True
>> Unload UserForm1
>> End If
>> End Sub
>>
>> If you are doing what I think you are doing, you should know (at least
>> I'm
>> pretty sure that) your password will be embedded in the saved workbook as
>> plain text; viewable with a plain text editor like Notepad. True, someone
>> would have to know where to look, but it might be easy to locate. You
>> might
>> want to encrypt it a little bit to make it harder to find. One way,
>> perhaps,
>> would be to mix it in between other characters (maybe locating each
>> letter
>> as the 3rd character in a much bigger string of characters) and run a
>> loop
>> to pick them out.
>>
>> Rick
>>
>>
>> "pswanie" <(E-Mail Removed)> wrote in message
>> news:8F7B5254-769E-40C8-BB39-(E-Mail Removed)...
>> > my previous posting was not clear i think...
>> >
>> > what can i add to a command so that when i click it, it checks that
>> > textbox1
>> > got "mypass" and then run the sub
>> >
>> > i have a textbox on a userform and a commandbutton1.
>> > the aplication (excell workbook) is set to visible = valse
>> >
>> > click commandbutton1 go and check if textbox1 contain "mypass"
>> > commandbutton1 make the application visible = true and unload
>> > userform1.
>> >
>> > then i can get to my macros etc..
>> > i got this.
>> >
>> >
>> > Private Sub CommandButton5_Click()
>> >
>> >
>> > Application.Visible = True
>> > Unload UserForm1
>> >
>> >
>> > End Sub
>> >
>> >

>>
>>


 
Reply With Quote
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      20th Jan 2008
Put this right after your "Unload UserForm1" statement...

Application.OnKey "%{F11}"

Rick


"pswanie" <(E-Mail Removed)> wrote in message
news:91DC1F98-CB9F-4717-B678-(E-Mail Removed)...
>i needed to add that when userform unload and application vissible hapens.
> would it be possible to automate the alt & F11 keystroke?
>
>
>
>
> "pswanie" wrote:
>
>> my previous posting was not clear i think...
>>
>> what can i add to a command so that when i click it, it checks that
>> textbox1
>> got "mypass" and then run the sub
>>
>> i have a textbox on a userform and a commandbutton1.
>> the aplication (excell workbook) is set to visible = valse
>>
>> click commandbutton1 go and check if textbox1 contain "mypass"
>> commandbutton1 make the application visible = true and unload userform1.
>>
>> then i can get to my macros etc..
>> i got this.
>>
>>
>> Private Sub CommandButton5_Click()
>>
>>
>> Application.Visible = True
>> Unload UserForm1
>>
>>
>> End Sub
>>
>>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Automating 'From' Douglas J. Steele Microsoft Access Form Coding 0 7th Jun 2010 01:13 PM
REALLY need help automating Cam Microsoft Excel Programming 10 9th Jun 2008 03:49 PM
Automating a CF2 App??? ink Microsoft Dot NET Compact Framework 4 10th Aug 2007 02:43 PM
Automating a .NET App Anthony Malt Microsoft C# .NET 7 3rd Apr 2006 05:48 PM
Automating PP from XL Keith R Microsoft Excel Programming 0 20th Nov 2003 08:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:34 PM.