Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Early vs late binding and macro problems in VBA 1

Status
Not open for further replies.

snetzky

Technical User
Mar 25, 2003
17
US
I was using Late binding to activate the Extra objects and everything was working fine. I tried switching over to using early binding and the Attachmate object library and now nothing works as VBA doesn't seem to wait for the screen object to complete tasks before continuing. I'm going back to the late binding approach, but I'm curious what i need to do differently to make early binding work, as I much prefer it.
 
That's curious. I was shifting to early binding because of the ease of programming with drop down menus.

However, I'm currently supporting 5 different versions of Extra, so early binding no longer works. So now, I write code using early binding, then remove the references and use late binding in the production code.

There are a few quirks I've found with methods (the Screen.MoveTo in particular), but overall there is no difference.

Do you have waits in your code? I typically use a wait function that I call after all actions:

Do While Sess0.Screen.OIA.Xstatus <> 0
Doevents
Loop

This will wait for the "X status" to disappear from the bottom of the screen.

calculus
 
Thanks calculus.

I was using a different approach for the wait routine:
oScreen.OIA.XStatus <> 5

That may have been the issue.

This was mostly being used in conjunction with a problem with errors messing up my macro.
 
Okay..I've tried it both ways and it seems to blow up during the login process only. Any other ideas?
 
Have you stepped through it? Where does it blow up?

calculus
 
I finally discovered that there was something else going on after the clock reset. I ended up doing the OIA.XStatus loop and then did a short waithostquiet

It's working, so I'm not going to get too excited.

Has to be good enough, doesn't have to be perfect.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top