How do I open a program(CADD) with VBA

  • Thread starter Thread starter Bryan_m
  • Start date Start date
B

Bryan_m

I'm nearly done with my drawing index and it was brought up that i
would be nice to have the program once it found a drawing have th
option to open it in Bentley Microstation(Our CADD program)

I figured out how to open the program(via the executable), but I ca
not figure out how to open just a specific drawing(aka file
"drawingnumber.dgn") automatically.

The drawings will all be stored in the same directory on our network s
navigation through folders is not needed.

Basically need to know how to simulate the command a double click on
drawing runs. Choosing microstation as the program with which to ope
the file.

Thank you in advance,

Bryan M
 
I think that one should be simple:

First you need to find out how to open the program (Microstation) wit
a specific drawing from command prompt, usually by supplying the pat
name of the file as an argument to the executable will do it.

If you don't know you can find out by going in Control Panel/Folde
Options (For windows 2000 and XP)

Go to the "Folder Options" Tab and look for DNG, select it and click o
advanced and find the "Open" action

Select "Open" and click on edit and look in the field "Application use
to perform action"

Then just use the Shell function in Excel.

For example let's say that the executable is i
C:\Temp\microstation.exe, the drawing is in R:\Temp\Drw.dng and indee
it is just to supply the filename to open it. Then you can just run:

Shell ("C:\Temp\microstation.exe R:\Temp\Drw.dng")


To open with this specific drawing.


Hope this helps, let me know if you have problems and I'll try helpin
if I can.

Best Regards

Noo
 
works great :cool:
just changed it a bit to

shell("c:\WIN32APP\ustation\ustation.exe c:\WIN32APP\ustation\out\dgn\
& drawingtoopen & ".dgn")

the c drive in the filepath is just temporary because I don't have th
drawings uploaded to the server yet. (I didn't know you just had t
pass the pathname after the executable)

Thank you for your help, it is much appreciated
 

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

Back
Top