VbaNewbie08
Technical User
im having problems with the ** areas below.
I apologize im a newbie when it comes to this kind of stuff
Sub Main()
'Extra Objects
Dim System As Object
Dim ExScreen As Object
Set System = CreateObject("EXTRA.System")
Set ExScreen = System.ActiveSession.Screen
'Excel Objects
Dim appExcel As Object
Dim wbExcel As Object
Dim aSheet As Object
Set appExcel = CreateObject("Excel.Application")
Set wbExcel = appExcel.Workbooks.Open("P:\Accounts_Payable\Admin\Extra.xls")
Set aSheet = wbExcel.Sheets("Main")
For x = 1 To aSheet.UsedRange.Rows.Count
'ExScreen.SendKeys ("<clearpagecursorhome>")
ExScreen.PutString aSheet.Cells(2, 1).Text, 4, 34
ExScreen.PutString aSheet.Cells(2, 2).Text, 6, 34
ExScreen.PutString aSheet.Cells(2, 3).Text, 8, 34
ExScreen.PutString aSheet.Cells(2, 4).Text, 10, 34
ExScreen.PutString aSheet.Cells(2, 5).Text, 12, 34
ExScreen.PutString aSheet.Cells(2, 6).Text, 13, 34
ExScreen.PutString aSheet.Cells(2, 7).Text, 14, 34
ExScreen.PutString aSheet.Cells(2, 8).Text, 15, 34
ExScreen.PutString aSheet.Cells(2, 9).Text, 16, 34
ExScreen.SendKeys ("<Enter>")
ExScreen.WaitHostQuiet (xtraSettleTime)
**at this point if there is an error(s) it will show up in 23,12 thru 23,37 (error 1)and 24,12 thru 24,37 (error 2). I need it to copy error 1 to excel into column 28 and error 2 into column 29, then start over with the next row***
ExScreen.PutString aSheet.Cells(2, 10).Text, 12, 10
ExScreen.PutString aSheet.Cells(2, 11).Text, 12, 18
ExScreen.PutString aSheet.Cells(2, 12).Text, 12, 31
ExScreen.PutString aSheet.Cells(2, 13).Text, 12, 47
ExScreen.PutString aSheet.Cells(2, 14).Text, 12, 53
ExScreen.PutString aSheet.Cells(2, 15).Text, 12, 60
ExScreen.PutString aSheet.Cells(2, 16).Text, 12, 72
ExScreen.PutString aSheet.Cells(2, 17).Text, 15, 2
ExScreen.PutString aSheet.Cells(2, 18).Text, 15, 11
ExScreen.PutString aSheet.Cells(2, 5).Text, 15, 20
ExScreen.PutString aSheet.Cells(2, 6).Text, 15, 33
ExScreen.PutString aSheet.Cells(2, 8).Text, 15, 44
ExScreen.PutString aSheet.Cells(2, 19).Text, 15, 66
ExScreen.PutString aSheet.Cells(2, 20).Text, 15, 73
ExScreen.PutString aSheet.Cells(2, 21).Text, 18, 2
ExScreen.PutString aSheet.Cells(2, 22).Text, 18, 10
ExScreen.PutString aSheet.Cells(2, 23).Text, 18, 16
ExScreen.PutString aSheet.Cells(2, 24).Text, 18, 30
ExScreen.PutString aSheet.Cells(2, 25).Text, 18, 41
ExScreen.PutString aSheet.Cells(2, 26).Text, 18, 51
ExScreen.SendKeys ("<Enter>")
**at this point if there is an error(s) it will show up in 23,12 thru 23,37 (error 3)and 24,12 thru 24,37 (error 4). I need it to copy the error 3 to excel into column 30 and error 4 into column 31.***
**if no erros at this point i need it to copy a ref number generated by extra (24/29 thru 24/36) into column 27 in excel**
**and then it needs to loop until it hits a blank row***
Next
appExcel.Quit
End Sub
I apologize im a newbie when it comes to this kind of stuff
Sub Main()
'Extra Objects
Dim System As Object
Dim ExScreen As Object
Set System = CreateObject("EXTRA.System")
Set ExScreen = System.ActiveSession.Screen
'Excel Objects
Dim appExcel As Object
Dim wbExcel As Object
Dim aSheet As Object
Set appExcel = CreateObject("Excel.Application")
Set wbExcel = appExcel.Workbooks.Open("P:\Accounts_Payable\Admin\Extra.xls")
Set aSheet = wbExcel.Sheets("Main")
For x = 1 To aSheet.UsedRange.Rows.Count
'ExScreen.SendKeys ("<clearpagecursorhome>")
ExScreen.PutString aSheet.Cells(2, 1).Text, 4, 34
ExScreen.PutString aSheet.Cells(2, 2).Text, 6, 34
ExScreen.PutString aSheet.Cells(2, 3).Text, 8, 34
ExScreen.PutString aSheet.Cells(2, 4).Text, 10, 34
ExScreen.PutString aSheet.Cells(2, 5).Text, 12, 34
ExScreen.PutString aSheet.Cells(2, 6).Text, 13, 34
ExScreen.PutString aSheet.Cells(2, 7).Text, 14, 34
ExScreen.PutString aSheet.Cells(2, 8).Text, 15, 34
ExScreen.PutString aSheet.Cells(2, 9).Text, 16, 34
ExScreen.SendKeys ("<Enter>")
ExScreen.WaitHostQuiet (xtraSettleTime)
**at this point if there is an error(s) it will show up in 23,12 thru 23,37 (error 1)and 24,12 thru 24,37 (error 2). I need it to copy error 1 to excel into column 28 and error 2 into column 29, then start over with the next row***
ExScreen.PutString aSheet.Cells(2, 10).Text, 12, 10
ExScreen.PutString aSheet.Cells(2, 11).Text, 12, 18
ExScreen.PutString aSheet.Cells(2, 12).Text, 12, 31
ExScreen.PutString aSheet.Cells(2, 13).Text, 12, 47
ExScreen.PutString aSheet.Cells(2, 14).Text, 12, 53
ExScreen.PutString aSheet.Cells(2, 15).Text, 12, 60
ExScreen.PutString aSheet.Cells(2, 16).Text, 12, 72
ExScreen.PutString aSheet.Cells(2, 17).Text, 15, 2
ExScreen.PutString aSheet.Cells(2, 18).Text, 15, 11
ExScreen.PutString aSheet.Cells(2, 5).Text, 15, 20
ExScreen.PutString aSheet.Cells(2, 6).Text, 15, 33
ExScreen.PutString aSheet.Cells(2, 8).Text, 15, 44
ExScreen.PutString aSheet.Cells(2, 19).Text, 15, 66
ExScreen.PutString aSheet.Cells(2, 20).Text, 15, 73
ExScreen.PutString aSheet.Cells(2, 21).Text, 18, 2
ExScreen.PutString aSheet.Cells(2, 22).Text, 18, 10
ExScreen.PutString aSheet.Cells(2, 23).Text, 18, 16
ExScreen.PutString aSheet.Cells(2, 24).Text, 18, 30
ExScreen.PutString aSheet.Cells(2, 25).Text, 18, 41
ExScreen.PutString aSheet.Cells(2, 26).Text, 18, 51
ExScreen.SendKeys ("<Enter>")
**at this point if there is an error(s) it will show up in 23,12 thru 23,37 (error 3)and 24,12 thru 24,37 (error 4). I need it to copy the error 3 to excel into column 30 and error 4 into column 31.***
**if no erros at this point i need it to copy a ref number generated by extra (24/29 thru 24/36) into column 27 in excel**
**and then it needs to loop until it hits a blank row***
Next
appExcel.Quit
End Sub