Let me be the first to say that I don’t expect anyone to read this post. I am merely using this venue as a way to make my own personal notes on how I solved a huge frustration for me doing a task at work which required logging into multiple machines per day. If by some chance you found this content and it helped you or you have questions, leave a comment!
Problem: I have to log into multiple hosts using rdp (mstc /admin) per day. Clicking start > Run > mstsc /admin [hostname] took forever. I would type the commands, copy the hostname, paste… overall that simple process took around 15 seconds. Now, 15 seconds does not seem like a lot of time at first. However, connect to 100 hosts today and you’ve spent 25 minutes simply connecting to machines. Thats around 100 hours per year wasted. Having a button which is able to rdp from excel with one click would be much better!
1. Make your document macro enabled. File > Save As >Save as type: Excel Macro-Enabled Workbook (*.xlsm)
2. Click on developer tab in the top ribbon (farthest to the right)
3. Click on Visual Basic (this should load a new window for coding)
4. Click on Insert (“I”) and select new module
5. Copy this code:
RDPWindow = Shell(“C:\windows\system32\mstsc.exe /admin /v:” & “
hostname with the name of your host.
6. Paste the code in your new Module.
7. Save in Visual Basic Editor, and save your workbook.
8. Still in the Developer Tab, click on Insert (an icon with hammer and wrench on it)
9. In the drop down menu that appears, under the Form Controls section, select the button icon (top left)
10. Draw your button
11. Right click your new button, select assign macro
12. Select the new macro you just created, press ok
13. If desired rename your button to “connect to
14. Save and test.
15. Do a happy dance!
As always, input is gladly welcomed! Love you guys, hopefully this may help someone out there save some time.