Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

RE: Run-time error ‘2147417856 (80010100)’

$
0
0

Hi Hector,

[quote user="Wero"]This error happened when Microstation was controlled by Excel[/quote]

It does not relate to the reported problem, but I recommend to study Connecting to MicroStation from a Separate Process chapter in MicroStation VBA help, where different ways how to connect to MicroStation from other application are discussed.

[quote user="Wero"]The VBA Code worked well during the first 37 iterations[/quote]

The whole code, as you published it, is called many times? In such case it's wrong code in my opinion. You should established the connection to MicroStation once only and keeping this connection open, to provide run necessary code.

[quote user="Wero"]myMSAppCon.Application.CadInputQueue.SendCommand ("SAVE AS V8 C:\Users\Wero\Documents\....\MyFile.dgn")[/quote]

This is wrong usage of MicroStation VBA API. Important rule is to don't use SendCommand (and CadInputQueue in generall) at all ... only if it is really necessary. Very often to send key-ins or command to MicroStation can be easily replaced by calling a proper VBA method (which often offers better control and flexibility). In this case, see SaveAs method description in MicroStation VBA help.

[quote user="Wero"]Set myMSApp = Nothing[/quote]

Why do you set the object reference to Nothing? I don't see any reason (and I guess there is no reason to do it in VBA at all).

[quote user="Wero"]I have reviewed some information on the web but nothing related to Microstation.[/quote]

It's not a surprise: The error is cause by incorrect using COM Automation and not MicroStation itself. And the most often used applications in relation to automation are Office apps.

With regards,

  Jan


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>