Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DataGlobal Sheet
#1
Solved: 10 Years, 9 Months ago
Hello guys,

I have three different messages in the GlobalSheet that i want my script to run thru and post to my twitter page. I know it should be a FOR loop but have no idea how and where to write it. Can you guys help me? basically, at the end of the script I should have those three message posted on my page.
I created a for loop below and it is bold. when the script is run, it's only posting the first of three messages only. I want it to go tru all three. Please help me.

Thank.



Code:
Browser("Yahoo!").Page("Yahoo!").Sync
Browser("Yahoo!").Navigate "http://www.google.com/"
Browser("Yahoo!").Page("Google").WebEdit("search edit").Set "twitter.com"
Browser("Yahoo!").Page("Google").WebButton("Google Search").Click
Browser("Yahoo!").Page("twitter.com - Google Search").Link("Twitter").Click
Browser("Yahoo!").Page("Twitter").Link("Sign in").Click
Browser("Yahoo!").Page("Twitter").WebEdit("session[username_or_email]").Set "PriMeMiNiSteR"
Browser("Yahoo!").Page("Twitter").WebEdit("password").SetSecure "4ad8967a2b11bd3f6b64a0a0b"
Browser("Yahoo!").Page("Twitter").WebButton("Sign in").Click 0
While (1)
Browser("Yahoo!").Page("Twitter").WebEdit("message").Set DataTable("post", dtGlobalSheet)
[b]Dim rCount
For i = 1 to rCount
rCount= datatable.GetSheet("post").GetRowCount
Next
[/b]
Browser("Yahoo!").Page("Twitter").WebButton("update").Click
Browser("Yahoo!").Page("Twitter").Link("Home").Click

Wend
Reply
#2
Solved: 10 Years, 9 Months ago
Hi JeanFrederique
Following logic should help you
Code:
'get the row count of global sheet
rCount= datatable.GetSheet(dtGlobalsheet).GetRowCount
'use a for loop to iterate through all rows
For i = 1 to rCount
'set the current row of global sheet
Datatable.SetCurrentRow (i)
'set the message in your web edit
Browser("Yahoo!").Page("Twitter").WebEdit("message").Set DataTable("post", dtGlobalSheet)
Browser("Yahoo!").Page("Twitter").WebButton("update").Click
'Navigate back to your message posting page
Next

alternately you can iterate you message posting statements(only) through all the rows of global sheet by setting 'Run on all rows' at File . Settings, under Run Tab.

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  export data from one sheet to another sheet in data table raaj123 1 2,189 05-21-2013, 02:21 PM
Last Post: Shahzaad
Question Is Local sheet different from Global sheet in DataTable... Goldy 6 4,895 10-08-2008, 02:08 AM
Last Post: Goldy

Forum Jump:


Users browsing this thread: 1 Guest(s)