Sign in to follow this  
Followers 0
locutus243

Trapping Microsoft Access

5 posts in this topic

I am using my scripts with Microsoft Access. It sets off a macro and then waits for the message box to appear at the end of the macro to inform the user when the macro has finished. To wait for this message I'm using the WinWait function. But I'm finding it really hard to trap windows in Excel.

I have a form entitled Pubn To Interrogate and it can't seem to find it with either the title or the classname. I come across a similar problem with my message box that the macro throws out to show it has ended. I've tried activating Access first to try and ensure I capture the window but it just doesn;t seem to work.

Was wondering if anybody had any ideas or had encountered simialr problems???

Thanks

Mark

Share this post


Link to post
Share on other sites



Has nobody come across this then?? Am I not explaining the problem properly or is it just that no1 knows how to help??? (Hope this don't sound rude, u guys are usually so good at helping on here).

Thanks

Mark

Share this post


Link to post
Share on other sites

I would suggest posting the code, usually the users are more eager to help when they have code to work with rather than having to write code to try to simulate the problem you have described.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Here is the code I'm using so far, but it isn't recognising the Access window (WinWaitActive("classname=OFormPopup"))

And yes, I have WinMatchMode set to 4!!!

Func PostImpCheck()

_RunDos("start C:\Shortcuts\PubCheck.mam")

WinActivate("classname=OMain")

WinWaitActive("classname=OMain")

WinWaitActive("classname=OFormPopup")

Send("l6s")

Send("{ENTER}")

While MouseGetCursor() = 15

sleep(10)

WEnd

WinWaitActive("classname=#32770")

EndFunc[code=auto:0]

Share this post


Link to post
Share on other sites

I have found the reason why I can't see Access. Its because the script won't continue until the macro I set running with my _RunDos function has finished. However I want my script to interact with the macro. The macro brings up a form and I need my script to enter data. Therefore can anyone see a way round my problem???

Thanks

Mark

P.S. I have included my code below (hopefully in the right format this time)

Func PostImpCheck() 
_RunDos("start C:\Shortcuts\PubCheck.mam")

WinActivate("classname=OMain")
WinWaitActive("classname=OMain")
WinWaitActive("classname=OFormPopup")

Send("l6s")
Send("{ENTER}")

While MouseGetCursor() = 15
sleep(10)
WEnd

WinWaitActive("classname=#32770")
EndFunc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0