Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Pro/engineer from a excel VB 1

Status
Not open for further replies.

tazengr

Mechanical
Mar 1, 2007
34
0
0
DE
Hello,

I am trying to automate the process of mass creating parts.

What I would like to do is write a VB command that tells windows to launch pro/engineer in no graphics mode and run a trail file that is called mytrail_1.txt

I can run that trail file in pro/engineer in no graphics mode from the command line using:
"C:\Program Files\proeWildfire 3.0\bin\proe.exe" -g:no_graphics Mytrail_1.txt

and it runs fine.

However I took the same shell command and put it in VB as follows:

Private Sub Command1_Click()
Shell "C:\Program Files\proeWildfire 3.0\bin\proe.exe" - g: no_graphics Mytrail_1.txt, vbNormalFocus
End Sub

however i get an error saying
Compile error: Variable not defined
and the g before no graphics is highlighted

Note that I can launch pro/engineer from VB using:

Private Sub Command1_Click()
Shell "C:\Program Files\proeWildfire 3.0\bin\proe.exe", vbNormalFocus
End Sub

and no problems, but I would like to start and run that trail file in no graphics mode.

Any ideas?

Regards,

Taz Engr
 
Replies continue below

Recommended for you

Taz,

You will need to put - g: no_graphics Mytrail_1.txt, vbNormalFocus within the quotation marks just after proe.exe. This will tell VB that everything after the proe.exe are arguments.

If this doesn't work (which is sometimes doesn't) just create a bat file with your entire launch command with arugments. Then call that newly create bat file from VB. Should work.

Steve

Stephen Seymour, PE
Seymour Engineering & Consulting Group
 
Status
Not open for further replies.
Back
Top