ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I open a program(CADD) with VBA (https://www.excelbanter.com/excel-programming/302956-how-do-i-open-program-cadd-vba.html)

Bryan_m[_2_]

How do I open a program(CADD) with VBA
 
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

--
Message posted from http://www.ExcelForum.com


NooK[_23_]

How do I open a program(CADD) with VBA
 
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

--
Message posted from http://www.ExcelForum.com


Bryan_m[_3_]

How do I open a program(CADD) with VBA
 
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

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 12:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com