• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 837
  • Last Modified:

excel system call with spaces in program path

Hi,

I want to add a series of buttons to a spreadsheet that will run a program with different values.  The program path has a space in it, so I need to account for that.  The argurments may have spaces, but I am trying to eat the elephant one bite at a time.   I looked at http://www.experts-exchange.com/Programming/Languages/.NET/Q_21731126.html, but I get errors in my implementation.  On the DIm p1 statement I get:
   compile error  user defined type not defined
Help is appreciated.
Leon
Public Sub test_sys_call()
  Dim p1 As New Process
  p1.StartInfo.Filename = "C:\Program Files\ultravnc\vncviewer.exe" ' required
  p1.StartInfo.Arguments = "192.168.1.4" ' required
  p1.Start()
End Sub

Open in new window

0
leonvan
Asked:
leonvan
  • 2
1 Solution
 
Nate_OliverCommented:
Hello, I'm not familiar  with that Type, myself. I'd be tempted to try ShellExecute(), an API call, myself. There's a write-up, here:

http://www.suodenjoki.dk/us/productions/articles/vbashellexecute.htm

Ignore the fact that they're using PPT, it works in any VBA environment.
0
 
Nate_OliverCommented:
This might be a better overview on ShellExecute():

http://support.microsoft.com/kb/238245
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now