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

Macola "pull" vs. Excel "push" 2

Status
Not open for further replies.

fabyouless

Technical User
Mar 26, 2007
5
US
My prowess at Flex has grown since i've first started using Flex a year and a half ago. Still, i was wondering if it is possible to use Excel VBA to "push" information into a screen, e.g. SFSOADD.

Currently, i am using Flex to "pull" data from Excel. Upon given a range of Unreleased Shop Orders to delete, i've pasting the following code into VBA.
Code:
Option Explicit

Const myFile = "C:\Documents and Settings\Brian\My Documents\frm SOxVarH.xls"
Const myPlace = "J1"
Const myTopRow = 2
Const myOrdNo = 1
Dim myRow As Long

Private Sub OrderNo_GotFocus()
    Dim myXlBook As Object
    Set myXlBook = GetObject(myFile)
    With myXlBook.worksheets(1)
        myRow = .range(myPlace).Value
        If myRow < myTopRow Then
            myRow = myTopRow
        Else
            myRow = myRow + 1
        End If
        OrderNo.Text = .cells(myRow, myOrdNo).Value
        .range(myPlace).Value = myRow
    End With
    Set myXlBook = Nothing
    If OrderNo.Text <> "" Then
        SendKeys "{TAB}"
    End If
End Sub

Private Sub OrderType_GotFocus()
    If OrderPkg.Text = "MR" And OrderStatus.Text = "U" Then
        SendKeys "^d"
    Else
        macForm.Cancel
    End If
End Sub

Private Sub ItemNo_GotFocus()
    macForm.Cancel
End Sub

So, am i barking up the wrong tree? Have i already found the swiftest method at my disposal?

Thanks,
BLS
 
You have already found the best method. It is possible to push data to the Macola screen from an external application but it can only be done with great complexity.

To do this you would need to dive deep in to the Windows API and code a solution that allows you to do the following (I have added approximations of time required to code the solution):
1. Find the window that you wish to push data to (1 hour)
2. Use some mind boggling code to somehow figure out the entry field you wish to enter data to. About the only thing you can go off of here is placement on screen and/or tab order, there are no "names" for entry fields in the Windows API (10 hours)
3. Perform all the necessary coding to mimick user entry using a macro like coding technique. We can not just use the "Set" functions in the Windows API as this prevents Macola from realizing that the value has been changed. As you know in Flexibility you must have focus on a Macola field before you can change the value of the field. The same rule applies here. (15 hours)
4. Bring focus to the Macola screen (0.5 hours)

If you have never used the Windows API then add another 10-20 hours to the project to get acquainted.

There are other ways to do this. One way is to use Excel VBA with macro programming tool that costs in the neigborhood of $500 dollars. The macro tool can eliminate most of the complex API coding, but the solution would still take 20-30 hours to complete at a minimum.

Typically when I develop "push" solutions to Macola we push the data directly to the database or provide a custom interface that user data can be combined with push data and then write directly to the database. The push solution is most appropriate when the transactions are simple and little user input is required.

Scott Travis
 
You should consider the .com objects developed by Wisys if you are trying to push new SF orders from excel to Macola.

This is not the same as pushing it to a screen, but you can create SF orders directly from excel, and report production for that matter.

You can also add customers, vendors, items, OE orders, POP orders. etc., all thru excel.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
Great suggestion by dgillz if you need them, however I would think that they might be overkill for your needs. After all you already have a solution that works.

Scott Travis
 
Unless I missed something, your solution will only create SFC orders. With the Wisys .com objects, you can create, release, and complete the orders without having to through the manual effort in Macola.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
Thank you both for your kind responses. I now have confirmation to what i suspected, stravis. And i have a new methodology to possibly pursue, dgillz.
Have a great weekend!
 
Yep I did miss that Scott. Long week.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top