How to start an RDP seesion by clicking link.

M

Michael

I want to have a spreadsheet that list PCs etc. and have a clickable link
that starts a rdp file (so it keeps the username and pass) not just start
mstsc.exe.
I would like to have the text editable so when someone else use it they can
change the locaiton of the rdp files.
I tried objects but cant edit by search and replace.
Tried hyperlink with c:\windows\system32\mstsc.exe
c:\Users\Documents\KCMSD\RDP\askew.rdp
wont start
tried cmd but cant pass rdp file to it.
tried link to rdp and excel say program not associated with it.

Any help
 
V

Vergel Adriano

Michael,

How about a button instead of a hyperlink? assign a macro like this to the
button.

Sub Button1_Click()
Shell "mstsc D:\TEST.RDP", vbNormalFocus
End Sub

You can make the RDP file variable by getting it from a cell in the
worksheet instead of hard coding in the macro..
 
M

Michael

Hey I like that idea and it did start a specific file up ok.
Now, how do I use the text that is in the selected cell.
Or, have multiple buttons that will reference the cell that is in that same
row.

Thanks for helping a newbie!
 
M

Michael

Actually, even better would be if I could have the locaiton of the files
specified in one cell like L1 that would be c:\user\me\rdp\ and then in A1,
A2, etc. have the name of the location office1, office2, etc.
So then if you had the office1 cell selected and hit the macro button it
would combine them and tack on .rdp to get c:\user\me\rdp\office1.rdp and
execute that.
Then if someone else used they could put c:\user\you\rdp\ in L1 and the
macro would execute c:\user\you\rdp\office1.rdp for them.

Can you tell me exactly all the steps to do that?

Again sorry for being such a newb.
 
V

Vergel Adriano

Hi Michael,

If the path will be in L1. And the user will select a cell which will have
the name of the RDP file without the .RDP file extension. One way to do it
would be like this:

Shell "mstsc " & Range("L1").Text & ActiveCell.Text & ".RDP", vbNormalFocus
 
M

Michael

Your are Fantastic!
That worked,
Thanks so much.

Vergel Adriano said:
Hi Michael,

If the path will be in L1. And the user will select a cell which will have
the name of the RDP file without the .RDP file extension. One way to do it
would be like this:

Shell "mstsc " & Range("L1").Text & ActiveCell.Text & ".RDP", vbNormalFocus
 
M

Michael

Sorry to bug again.
When I have a cell with 2 words like "White House" it only puts the second
word in the string.
I'm sure its a simple fix like "" or something.
THANKS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top