Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" skrev i en meddelelse ... 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message ... 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message ... 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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message ... 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" wrote in message ... 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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Put this right after your "Unload UserForm1" statement...
Application.OnKey "%{F11}" Rick "pswanie" wrote in message ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Automating a workbook ??? | Excel Programming | |||
Automating Tab names | Excel Worksheet Functions | |||
Automating a checklist | Excel Programming | |||
Automating using VBA | Excel Worksheet Functions | |||
Automating PP from XL | Excel Programming |