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

page to page from screen to excel

Status
Not open for further replies.

braven

Programmer
May 20, 2009
58
CA
i have 5 screens. each screen has ctiy details
city and city name in sess.screen(5,12,5,23)
and name and acccount number 8 to 22
first screen grab all informaton into excel first sheet.
i did it. after that i am struggling with that
second screen more than one city name
how to open the second sheet and how to find city name
each city has more than 1 page second sheet first and second column have name and account number how to grab another city name in second sheet third column and how to grab that city name and account number
if one city i can do it in one sheet first column and second column with name and account number
city has fixed row 5,12, 523 and name and account number 8 to 22 in first page and it has more than 1 page and different city name . pleae help me how to do it. any example of coding?
 
this below code sofar created but set x1_sheet_2 has error object value set to nothing
and i need to grab from screen in sheet2 please help me.thanks!
Sub NextScreen()
Dim Name as String, Accountnumber As String
Dim j As Integer
Dim xl As Object, xl_wb As Object, xl_sheet_2 As Object, file_name As String
Dim dict As Object

Dim Sess As Object
Set xl_sheet_2 = xl_wb.Sheets("Sheet2")
xl_sheet_2.Name = "Mannai"


Sess.Screen.SENDKEYS("<Home>GD<Tab>*<EraseEOF><Tab>abcd<Enter>")
Set xl_sheet_2 = xl_wb.Sheets("Sheet2")
xl_sheet_2.Name = "Mill 2"
xl_sheet_2.Range("1:1").Font.Size = 12
xl_sheet_2.Columns("A").ColumnWidth = 17
xl_sheet_2.Columns("B").ColumnWidth = 25

xl_sheet_2.Cells(1,2) = Trim(Sess.Screen.GetString(5, 12, 13))

xl_sheet_2.Cells(2,1)= "Name"
xl_sheet_2.cells(2,2)= "AccountNumber"

j = 2
'last_row = xl_sheet_1.Range("B1").CurrentRegion.Rows.Count
Do
For j = 8 To 22
Journalid = Trim(Sess.Screen.GetString(i, 12, 10))
Description = Trim(Sess.Screen.GetString(i, 34, 19))

j = j + 1
xl_sheet_1.Cells(j, "A").Value = Name
xl_sheet_1.Cells(j, "B").Value = AccountNumber


Next j
Sess.Screen.SendKeys ("<PF8>")
Call Wait(Sess)
Loop Until Ucase(Sess.Screen.GetString(24, 8, 11)) = "END OF LIST"

 


Hi,

You never set the xl_wb object to a particular Excel workbook.

Check out the CreateObject and GetObject methods. You must create an Excel application object and then use GetObject to open a workbook.

Skip,
sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Thanks skipvought
i did it
here it is previous code is one part only
here is the main one
and another part of code has created in excel sheet1. the above code is not opening up sheet 2 adn it says object set value is nothing
Sub Main()


Set Sys = CreateObject("Extra.System")



If Sys Is Nothing Then
MsgBox ("Could not create Extra.System...is E!PC installed on this machine?")
Exit Sub
End If

Set Sess = Sys.ActiveSession

If Sess Is Nothing Then
MsgBox ("No session available...stopping macro playback.")
Exit Sub
End If

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''



Sess.Screen.SENDKEYS
Dim xl As Object, xl_wb As Object, xl_sheet_1 As Object, file_name As String

Dim i As Integer, j As Long
Dim dict As Object



file_name = "C:\Documents and Settings\mnr\test.xls

sFile = file_name
Set xl = CreateObject("Excel.Application")
'Set xl_wb = xl.Workbooks.Open(file_name)
Set xl_wb = xl.Workbooks.Add

xl_wb.SaveAs(sFile)
Set xl_sheet_1 = xl_wb.Sheets("Sheet1")



xl_sheet_1.Name = "Sheet1"

xl.Visible = True
xl.DisplayAlerts = False

 
Hi skip this inside the call function
the excel sheet already open but it says object value is set to nothing
Sess.Screen.SENDKEYS("<Home>GD<Tab>*<EraseEOF><Tab>abcd<Enter>")
and another one how to do
city name has 5,12,5,24
and below that rows 8 to 12 and column 24 to 48
and next page how to pickup the different city name in excel sheet.and corresponing in different colum
it grabs everything including city in one column
i need to put it in different colum with different city name and corresponding detials. please help me.
thanks

 
hi!
how do i compare the screen value in first and next page
for example if i have 5,20,5,25 vlaue = x in first page print out, if it has different one in second page priut out
i dont know how to write in Extra!
compare first page value = second page value
please help me .
thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top