Open another program (VNC Viewer) and insert an address

O

one sick moo

I want some VBA code to activate a program called VNCViewer then paste in an
address and activate.
I have been able to open the program using the following code:

Private Sub cbVNC_Click()

Dim Program As String
Dim TaskID As Double
On Error Resume Next

Program = "C:\Program Files\RealVNC\VNC4\vncviewer.exe"
TaskID = Shell(Program, 1)

End Sub

Which opens the program no problem. Any ideas how I can pass an address to
it and get it to look it up? The action of this would be to paste in the data
then press return

Thanks
 
P

papou

Hello
Not sure if this works with your VNC version but you may try from the
commandline eg:

Dim ipAddress
ipAddress = "123.4.5.6"
Program = "C:\Program Files\RealVNC\VNC4\vncviewer.exe" & " server:" &
ipAddress

NB: this works with UltraVNCViewer

HTH
Cordially
Pascal
 
O

one sick moo

Thanks papou

Looks like it's on the right track but not quite there. I get the error
message
"getaddrinfo: no such host is known. (11001)"
I'm using an IP address I know works, although of course I am asked to enter
a password - could that be the problem?

Thanks
osm
 
P

papou

As I said I can hardly tell whether this works with your VNC version.
Have you tried from the Windows Start/Run menu?

Cordially
Pascal
 
O

one sick moo

Hi
No I haven't. Not quite sure what you mean!

I have a folder of VNC link files. If I could simply activate one of these
from inside the code it would do the job and get around any password issues...

Regards
OSM
 
P

papou

Try and execute the program line from your code into the "Run" window
available from the Windows "Start" button.
eg:
From the Windows menu (that is NOT in Excel):
Start
Run
"C:\Program Files\RealVNC\VNC4\vncviewer.exe" "server:123.4.5.6"
Ok

And see if this works.

HTH
Cordially
Pascal
 
P

papou

Well hopefully somebody else will come up with something?
If not then why not change your version to UltraVNC?
;-)

Cordially
Pascal
 

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