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!

write from excel to Extra!

Status
Not open for further replies.

shawwallace

Technical User
Feb 9, 2008
19
CA
this is staring point from excel to Extra!
is it any corrections in that code

Sub 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("Datasheet")

 
Hi!
thank you very much for your help.
the below code does it have any correction
from vt session

if it is more than two rows in excel that mean 14 and 15 press enter to next screen ( how do i write this codeas condition)


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)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top