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

Input id numbers from Excel using Extra script 1

Status
Not open for further replies.

rebie

Technical User
Jan 29, 2007
9
US
Hello All,

I have been browsing similar threads about this topic, put I just can't seem to put it all together. And what I need I think is farily simple for you gurus.

I have a list of member id numbers in a spreadsheet, starting in Column 1, Row 1 and going up to Row n. It will always only have one column.

The script needs to start in the first cell, grab the id number, go to my Extra session (already running) and use the id number to create a new member in my membership system. Then, when that member is done, go grab the next id number, and do the member create steps again, etc., until the last id number in the sheet is processed. I've already got the member create steps created, I just need the steps to work with Excel and then loop through the id numbers. I'd like to just use the Extra language and not VBa (at this point) since I'm only using Excel to temporarily hold the ids, and don't really need to interface with it otherwise.

Thanks for any help,
rebie
 
Should get you started.

Code:
Sub Main

    Dim appExcel As Object
    Dim wbExcel As Object
    Dim aSheet As Object
    Dim MemIdNum As String
    
    Set AppExcel = CreateObject("Excel.Application")
    Set wbExcel = AppExcel.WorkBooks.Open("Drive/YourFile.xls")
    Set aSheet = wbExcel.Sheets("SheetName")

    For x = 1 to aSheet.UsedRange.Rows.Count
        MemIdNum = aSheet.Cells(x,1).text
        'Do your member setup here
        msgbox MemIdNum
     Next 

    appExcel.Quit
End Sub

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
Thank you, Mr.Milson. This did it.

-rebie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top