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!

From excel file to Extra!

Status
Not open for further replies.

shawwallace

Technical User
Feb 9, 2008
19
CA
i have standard excel template file user enters the datas.
is it posssible can i transfer from excel to Extra!
please provide the code . I did search here. But it is confusing. could you provide the code please
thanks
 



Shaw,

You are not going to get a fully coded solution, as you keep fishing for. This is Tek-Tips.

You have already been given quite a few TIPS regarding this topic.

Where is YOUR code? What part are you having problems with?

Skip,

[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue]
 
Skip
i just starting now. so just how to grab from excel to Extra!
and then i will develop then and there. could yu provide that one.
thanks
 



You have already been given code for setting the System, Session and Screen objects AS WELL AS this code...
Code:
dim r as range, lRowOut as long
for each r in activesheet.range(activesheet.[F4], activesheet.[F4].end(xldown))
  oScrn.Area(lRowOut ,1,lRowOut ,80).Value = r.value
  lRowOut = lRowOut +1
next
Where is your code and where are you having problems????

Skip,

[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue]
 
sKIP
THE code which i provided could you see where is the problem it is not coping from excel.
i have posted the code earlier posting
from excel to Extra!
 



I do not see it in this post.

Please post here.

Explain in detail where the problem is.

Skip,

[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue]
 
sKIP
THANKS A LOT. HERE IT IS
copy from excel 14c,14d,14e,14f,14g.14h to screen
Supplier Account 10,7, 5 ( 10th row, 7th column 5 total string)
Supplierunit 10,15,5
Supplier quantity 10,23,7
Supplierpartnumer 10,33,3
Product 10,39,4
Custg 10,67,5


from row 15c,15d,15e,15f,15g.15h
Supplier Account 16,7, 5
Supplierunit 16,15,5
Supplier quantity 16,23,7
Supplierpartnumer 16,33,3
PRODuct 16,39,4
custg 16,67,5

HERE IS THE CODE FULLY

dim r as range, lRowOut as long
Main

Dim appExcel As Object
Dim wbExcel As Object
Dim aSheet As Object
Dim Sessions as Object
Dim System as Object
Dim AccountNum As String
Dim Sess0 as Object


Set System = CreateObject("EXTRA.System")
Set Sessions = System.Sessions
Set Sess0 = System.ActiveSession

If (Sessions is Nothing) Then
Msgbox "Could not create the Sessions collection object. Stopping macro playback."
STOP
End If

Set AppExcel = CreateObject("Excel.Application")
If (System is Nothing) Then
Msgbox "Could not create the EXTRA System object. Stopping macro playback."
STOP
End If


Set wbExcel = AppExcel.WorkBooks.Open("C:\Program Files\ScriptTest.xls")
Set aSheet = wbExcel.Sheets("Activesheet")
i = 14 to 15
activesheet.Cells(i,c)= "SupplierAccount"
activesheet.cells(i,d)= "Supplierunit"
activesheet.Cells(i,e)= "supplierquantity"
activesheet.Cells(1,f)= "supplierpartnumber"
activesheet.Cells(1,g)= "partnumber"
activesheet.Cells(1,h)= "custg"


Trim(Sess.Screen.getString(10,7, 5)).value = activesheet.cells(i,c)
Trim(Sess.Screen.getString(10, 15,5)).value = activesheet.cells(i,d)
Trim(Sess.Screen.putString(10, 23,3)).value = activesheet.cells(i,e)
Trim(Sess.Screen.putString(10,33,3)).value = activesheet.cells(i,f)
Trim(Sess.Screen.putString(10,39,4)).value = activesheet.cells(i,g)
Trim(Sess.Screen.putString(10,67,5)).value = activesheet.cells(i,h)
Trim(Sess.Screen.getString(16,7, 5)).value = activesheet.cells(i,c)
Trim(Sess.Screen.getString(16, 15,5)).value = activesheet.cells(i,d)
Trim(Sess.Screen.putString(16, 23,3)).value = activesheet.cells(i,e)
Trim(Sess.Screen.putString(16,33,3)).value = activesheet.cells(i,f)
Trim(Sess.Screen.putString(16,39,4)).value = activesheet.cells(i,g)
Trim(Sess.Screen.putString(160,67,5)).value = activesheet.cells(i,h)

 

Code:
Dim r As Range, lRowOut As Long
'[s]Main[/s]

    Dim appExcel As Object
    Dim wbExcel As Object
    Dim aSheet As Object
    Dim Sessions As Object
    Dim System As Object
    Dim AccountNum As String
    Dim Sess0 As Object
    
'you have not set this up as posted in pervious examples...
    Set System = CreateObject("EXTRA.System")
    Set Sessions = System.Sessions
    Set Sess0 = System.ActiveSession

    If (Sessions Is Nothing) Then
        MsgBox "Could not create the Sessions collection object.  Stopping macro playback."
        Stop
    End If
'why are you setting th excel application object when you are
'"i have standard excel template file user enters the datas.
'is it posssible can i transfer from excel to Extra!"

'    Set appExcel = CreateObject("Excel.Application")
    If (System Is Nothing) Then
        MsgBox "Could not create the EXTRA System object.  Stopping macro playback."
        Stop
    End If
    
'same question, is the workbook not open and running this code???
    Set wbExcel = ActiveWorkbook
'do you ACTUALLY have a sheet tab Activesheet????
    Set aSheet = wbExcel.Sheets("Activesheet")
    For i = 14 To 15
    ' you have c, d, e, f, g & h as VARIABLES.  Should be literal values.
        aSheet.Cells(1, "c") = "SupplierAccount"
        aSheet.Cells(1, "d") = "Supplierunit"
        aSheet.Cells(1, "e") = "supplierquantity"
        aSheet.Cells(1, "f") = "supplierpartnumber"
        aSheet.Cells(1, "g") = "partnumber"
        aSheet.Cells(1, "h") = "custg"
           
        Sess.Screen.getString(10, 7, 5).Value = Trim(aSheet.Cells(i, "c"))
        Sess.Screen.getString(10, 15, 5).Value = Trim(aSheet.Cells(i, "d"))
        Sess.Screen.putString(10, 23, 3).Value = Trim(aSheet.Cells(i, "e"))
        Sess.Screen.putString(10, 33, 3).Value = Trim(aSheet.Cells(i, "f"))
        Sess.Screen.putString(10, 39, 4).Value = Trim(aSheet.Cells(i, "g"))
        Sess.Screen.putString(10, 67, 5).Value = Trim(aSheet.Cells(i, "h"))
        Sess.Screen.getString(16, 7, 5).Value = Trim(aSheet.Cells(i, "c"))
        Sess.Screen.getString(16, 15, 5).Value = Trim(aSheet.Cells(i, "d"))
        Sess.Screen.putString(16, 23, 3).Value = Trim(aSheet.Cells(i, "e"))
        Sess.Screen.putString(16, 33, 3).Value = Trim(aSheet.Cells(i, "f"))
        Sess.Screen.putString(16, 39, 4).Value = Trim(aSheet.Cells(i, "g"))
        Sess.Screen.putString(16, 67, 5).Value = Trim(aSheet.Cells(i, "h"))
     Next i

Skip,

[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top