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!

Extra Object.Paste: HOw do I assign it to a variable 1

Status
Not open for further replies.

jackeroo75

Technical User
Aug 26, 2007
34
US
Scenario:

I tried MyNumber$= Sess0.Session.Paste and when I debug it it shows "" or "Empty". But when I use Sess0.Session.Paste it paste the 9 digit number to my active screen. Why can't I assign this?

I created a macro that copy a 9-digit number in active session in Extra by using BaNumber$ = MyScreen.GetString$(x, y, 9). Then asked the macro to move to a different screen and paste the number.

Problem arises when I use the macro in the wrong page in Extra. screen. Instead of getting a 9 digit number I would instead get " ". I want my Banumber to compare my Sess0.Seesion.Paste so my macro can choose the correct one with the 9-digit number.

jackeroo75
 
Why not use PutString? Before pulling the 9-digit number, you should check first to see if the page is in fact the 9-digit number page by searching for a specific string on the page.
Code:
   header = UCase(Trim(Sess.Screen.GetString(y-1, x, 9)))

   If header = "9-DIGIT" Then
      BaNumber = Sess.Screen.GetString(y, x, 9)
      Sess.Screen.SendKeys ("<Pf8>") ' F8 key to advance the page

      Do While Sess.Screen.OIA.Xstatus <> 0
         DoEvents
      Loop

      Sess.Screen.PutString BaNumber, row_num, col_num
   End if
 
I will give this a try, but I'm not understanding why the do while loop is in the middle of the if statement.

Also is there a way to get the data from the Sess.Session.Paste by storing it in a variable??


Jackeroo75
 
WinblowsMe-

Your code worked! I hard-coded the row and col because it will never change and used IsNumeric on header variable ..if IsNumeric = -1 (A number) then change the banumber.

Thank you again for your quick response!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top