Close Design File from Visual Basic

Status
Not open for further replies.

Darren D

Usenet Archive
Joined
Nov 30, 2001
Messages
20
Reaction score
0
I am currently running a small VB application (started from within Microstation)to process some files. At the end of this processing loop I want to close the last design file so it takes me back to the "Microstation Manager" dialog box. I have tried the following:

Set msapp = CreateObject("Microstation.application")
Set mspoint = msapp.mbepoint

msapp.mbesendcommand "close design"

This seems to work, But the VB application stalls then returns a runtime error '7' - Out of Memory.....

I am fairly new to VB so it is quite possibly a case of me doing something wrong....OR Is there a different way to approach this....????

Any Help greatly appreciated

Thanks

Darren D.
 
Darren,

You can do it quite easily using OLE itself! Simply issue the "Close" method of the document object:

msapp.ActiveDocument.Close

Make sure that you cleanup in VB before exiting
("Set msapp = Nothing"). I use this currently with no
problems.

Now if only MicroStation had a corresponding "Open"
method available via OLE <grrrr>...

Hope this helps!

Regards,

Lloyd Charlier

SpatiaX Infosystems
"extending the enterprise..."

E-mail:
Web: http://www.SpatiaX.com

"Darren D" wrote:

I am currently running a small VB application (started from within Microstation)to process some files. At the end of this processing loop I want to close the last design file so it takes me back to the "Microstation Manager" dialog box. I have tried the following:

Set msapp = CreateObject("Microstation.application")
Set mspoint = msapp.mbepoint

msapp.mbesendcommand "close design"

This seems to work, But the VB application stalls then returns a runtime error '7' - Out of Memory.....
...
 
Many Thanks Lloyd....I'll give it a try when I get back into the office Monday....

Regards

Darren

"Lloyd Charlier" wrote:
Darren,

You can do it quite easily using OLE itself! Simply issue the "Close" method of the document object:

msapp.ActiveDocument.Close

Make sure that you cleanup in VB before exiting
("Set msapp = Nothing"). I use this currently with no
problems.

Now if only MicroStation had a corresponding "Open"
...
 
Status
Not open for further replies.

Latest threads

Back
Top