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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Automation

Status
Not open for further replies.

TardisInc

MIS
Sep 3, 2003
22
US
I have a client that wants to delete about 100 cost centers (departments). So, he has to remove complimentary info, purge history, print a transaction report and then delete the G/L acct code. Way too many.

So, I want to automate the appropriate screens by either doing a 'sendkeys' for each box, with a SPACE on the OK button to trigger it - OR - load each field programmatically that then locate and trigger the OK button.

Any points on what to put where? What, if anything, goes into the form init event? What about the printing box? How do I get it to trigger the FILE option (I can autogenerate filenames)? So far, in the printing box, Macola just hangs, whether I use TRUE or not at the end of SENDKEYS.


Thanks,
Larry Wilson
larry@tardissystems.com
972-768-2965
 
I might suggest that someone ought to just sit down for 4 hours and delete these cost centers, purge, and delete your GL accounts. This is probably how I would approach this. Flexibility was just not intended to be utilized to completely automate Macola. It was intended to provide trigger points behind individual Macola screens with the exception of the Main User Interface (Progression Explorer) and printer dialogs. Automation of these windows requires extensive Windows API calls and tends to be cost prohibitive. Anyway the choice is yours; this is just my 2 cents.

If you choose to automate then please provide specific code and a description of it's context (stand-alone, vba, etc...) that is causing you problems.

Scott Travis
infoSpring, LLC.
 
Your suggestion is what I advised to start with. However, they have over 2000 G/L codes to delete, and with 3 screens each - total about 2 minutes, that's more than they want to do.

Are you saying that SendKeys won't work on main screens?

Would the printer screen act differently, for some reason?

Thanks,
Larry Wilson
 
Perhaps you can automate deletions through the database?

The SendKeys command will work on any screen so long as you have proper focus on that screen. It is also important that you no your current focus within that screen.

I'm not sure what you mean be the printer screen acting differently. To clarify, the printer screen is not directly accessible through Macola Flexibility. Meaning that events occurring on this screen are not fired within Flexibility and the controls on this screen are not accessible from within Flexibility.

Regards,
Scott Travis
infoSpring, LLC.
 
Scott,


Actually, the VBA events within the printing screen are accessible thru VBA. Macola's website says that, on any such screen - without the VBA button - just SHIFT-RTCLK on the screen, then go to your VB interface. You will see the print screen there, and I intercept events there just fine. It's the SendKeys I'm having a problem with, though now that I think about it, I may just have to delete my current project and start over; I think VBA is screwed up.
 
Woops,

I sometimes fall in to this trap, and it appears that I have fallen in to it again. It use to be that you couldn't apply Flexibility code behind the Macola Print Dialog, but I just tested and found that not be the case anymore. The code you need to select the "File Option", in it's most basic form is below.

Code:
Private Sub File_GotFocus()
    ' This changes the value of the option button
    File.Selected = True
End Sub

Private Sub Printer_GotFocus()
    ' This event is fired when the form is opened
    File.SetFocus
End Sub

Scott Travis
infoSpring, LLC.
 
I just saw your last message. Thank you for the correction. Macola's Flexibility product was severly limited in the beginning and I'm afraid that this is just one of the limitations that I assumed still existed.

Scott Travis
infoSpring, LLC.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top