Opening VB program from Navision

Hello, Similar to my last topic but the other way around this time. We have successfully managed to create a simple VB program and we are trying to pass parameters from navision to the program using the shell command. When we use the run function from windows desktop and put the parameter into the command line, the program works fine. The problem comes when we use the shell command - it doesn’t seem to pick up the parameter at all. The VB code we are running is Module Module1 Public Sub Main(ByVal args() As String) MsgBox(“This is Sub Main”) If args.Length > 0 Then MsgBox(“Something Found”) Else MsgBox(“Nothing Found”) End If End Sub End Module So if in the Run from the Start menu on windows you put C:\MYVBPROG.EXE AAA and do Okay You get 2 messages ‘This is Sub Main’ followed by ‘Something Found’ From Navision using Shell as SHELL(‘C:\MYVBPROG.EXE’,‘AAA’) you also get 2 messages BUT ‘This is Sub Main’ followed by ‘Nothing Found’. Any ideas why or how to cure it?

John, why are you passing the array parameter ??, I think you just need a single string parameter

Hi Ajay, Thanks for the response, the example we have chosen is from a training manual, and as i said in my last posting, i am a VB.net novice. If you can give me an example of how you would do this, please let me know, it would be a massive help and should put me back on the right road. Thanks again John

SHELL('c:\myvbprog.exe aaa');will probably work. Somehow the SHELL command in Attain doesn’t work like it used to in previous versions. According to the online help this should work:SHELL(ENVIRON('ComSpec'),'/c','dir'); you would expect it to do a normal DIR - but it only opens cmd/command.com and ignores the parameters. Whereas SHELL(STRSUBSTNO('%1 %2 %3',ENVIRON('ComSpec'),'/c','dir')); works.

Thanks Soren! Thats exactly what we needed to know. Thanks for your help!!