Help with Sendkey

Mr Retirement

New Member
Joined
Nov 12, 2016
Messages
46
Hello,

I'm trying to automatically enter my username and password that is prompted from a userform. I'm attempting to use the code below. It works fine without the userform present...but when the userform is the active screen, the macro stops working and is waiting for my input. Is there any code that I can use to type into a userform? I unfortunately do not have access to the actual userform code - I need moreorless a keystroke macro to run when prompted - is this possible?

Code:
Sub Login()

SendKeys "Username"
SendKeys "{Tab}"
SendKeys "Password"
SendKeys "{Tab}"
SendKeys "{Tab}"
SendKeys "{Enter}"


End Sub

Thanks,
Mr R.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
.
If you do not have access to the UserForm code .... how will you implement any code within the project ?

It sounds like you are dealing with a workbook that is password protected ? Do you have the password ?
 
Upvote 0
I have access to everything except the userform that is prompting the username/password login. This is because (i think) it is built within an addin that - yes is password protected.

My thought was to be able to use Sendkey to automatically type login information within the prompt - but that hasn't worked.

Mr R.
 
Upvote 0

Forum statistics

Threads
1,223,879
Messages
6,175,147
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top