bsharath
asked on
Any script which can fill the time sheet
Hi,
I need to fill the time sheet every day .Is there a way to enable keystoke that can open the intranet site need 3 click that can finish the job.
Any way to automate this.
regards
Sharath
I need to fill the time sheet every day .Is there a way to enable keystoke that can open the intranet site need 3 click that can finish the job.
Any way to automate this.
regards
Sharath
ASKER
Hi webtubbs,
I need to go to a intranet website every day to fill in the details on how many hrs i have worked for the day.
The Hrs is the same and we have a favorites set where in when we click it the details come automatically.
What i mean is all the settings is preset.So need a script which can open that webpage.Instruct it to click these buttons as defined (Or where ever text found as define Click on it) At last save settings and close Ie.
I need to go to a intranet website every day to fill in the details on how many hrs i have worked for the day.
The Hrs is the same and we have a favorites set where in when we click it the details come automatically.
What i mean is all the settings is preset.So need a script which can open that webpage.Instruct it to click these buttons as defined (Or where ever text found as define Click on it) At last save settings and close Ie.
Hi, you could try something like this, but you'd need to identify the "names" of the controls that hold data, and click a button:
'=============
strURL = "http://mysite.com"
Set objIE = CreateObject("InternetExpl orer.Appli cation")
objIE.Navigate strURL
objIE.Visible = True
While objIE.Busy
Wend
objIE.Document.ALL("hours" ).Value = 8
objIE.Document.ALL("name") .Value = "Full Name"
objIE.Document.ALL("Submit ").Click
Set ObjIE = Nothing
'=============
Regards,
Rob.
'=============
strURL = "http://mysite.com"
Set objIE = CreateObject("InternetExpl
objIE.Navigate strURL
objIE.Visible = True
While objIE.Busy
Wend
objIE.Document.ALL("hours"
objIE.Document.ALL("name")
objIE.Document.ALL("Submit
Set ObjIE = Nothing
'=============
Regards,
Rob.
ASKER
Rob where should i give the clicks.
As first it need to click "Load Defaults" (Button)
And then change the duration to 9 hrs and 00 min (Drop down menu)
and then click "Save Duration" (Button)
As first it need to click "Load Defaults" (Button)
And then change the duration to 9 hrs and 00 min (Drop down menu)
and then click "Save Duration" (Button)
You will have to "view source" on the code, and find the names of the those controls, but once you have those, change this:
objIE.Document.ALL("hours" ).Value = 8
objIE.Document.ALL("name") .Value = "Full Name"
objIE.Document.ALL("Submit ").Click
to this, replacing the names in the quotes with those you obtain from the page:
objIE.Document.ALL("btnLoa dDefaults" ).Click
objIE.Document.ALL("hours" ).Value = "9 hrs and 00 min"
objIE.Document.ALL("btnSav e").Click
Regards,
Rob.
objIE.Document.ALL("hours"
objIE.Document.ALL("name")
objIE.Document.ALL("Submit
to this, replacing the names in the quotes with those you obtain from the page:
objIE.Document.ALL("btnLoa
objIE.Document.ALL("hours"
objIE.Document.ALL("btnSav
Regards,
Rob.
ASKER
ASKER
I dont know if the uploaded file will help...
ASKER
I get this...
-------------------------- -
Windows Script Host
-------------------------- -
Script: C:\Documents and Settings\sharathr\Desktop\ Timesheet. vbs
Line: 10
Char: 1
Error: Object required: 'objIE.Document.ALL(...)'
Code: 800A01A8
Source: Microsoft VBScript runtime error
-------------------------- -
OK
-------------------------- -
--------------------------
Windows Script Host
--------------------------
Script: C:\Documents and Settings\sharathr\Desktop\
Line: 10
Char: 1
Error: Object required: 'objIE.Document.ALL(...)'
Code: 800A01A8
Source: Microsoft VBScript runtime error
--------------------------
OK
--------------------------
The uploaded file looks like the code of the parent page. Does it load another page within this, that has the buttons you are after?
Rob.
Rob.
ASKER
Try these lines:
objIE.Document.ALL(""btnLo adDefaults "").Click
objIE.Document.ALL("sltSTH rs").Item( "9").Selec t
objIE.Document.ALL("sltSTM ins").Item ("0").Sele ct
objIE.Document.ALL("sltETH rs").Item( "17").Sele ct
objIE.Document.ALL("sltETM ins").Item ("0").Sele ct
objIE.Document.ALL("btnSav eSettings" ).Click
I'm not sure about the time ones, I haven't tried auto-setting a list box before....
Regards,
Rob.
objIE.Document.ALL(""btnLo
objIE.Document.ALL("sltSTH
objIE.Document.ALL("sltSTM
objIE.Document.ALL("sltETH
objIE.Document.ALL("sltETM
objIE.Document.ALL("btnSav
I'm not sure about the time ones, I haven't tried auto-setting a list box before....
Regards,
Rob.
ASKER
Can i have the full code Rob...
'=============
strURL = "http://mysite.com"
Set objIE = CreateObject("InternetExpl orer.Appli cation")
objIE.Navigate strURL
objIE.Visible = True
While objIE.Busy
Wend
objIE.Document.ALL(""btnLo adDefaults "").Click
objIE.Document.ALL("sltSTH rs").Item( "9").Selec t
objIE.Document.ALL("sltSTM ins").Item ("0").Sele ct
objIE.Document.ALL("sltETH rs").Item( "17").Sele ct
objIE.Document.ALL("sltETM ins").Item ("0").Sele ct
objIE.Document.ALL("btnSav eSettings" ).Click
Set ObjIE = Nothing
'=============
Regards,
Rob.
strURL = "http://mysite.com"
Set objIE = CreateObject("InternetExpl
objIE.Navigate strURL
objIE.Visible = True
While objIE.Busy
Wend
objIE.Document.ALL(""btnLo
objIE.Document.ALL("sltSTH
objIE.Document.ALL("sltSTM
objIE.Document.ALL("sltETH
objIE.Document.ALL("sltETM
objIE.Document.ALL("btnSav
Set ObjIE = Nothing
'=============
Regards,
Rob.
ASKER
I get this Rob...
-------------------------- -
Windows Script Host
-------------------------- -
Script: C:\Documents and Settings\sharathr\Desktop\ Timesheet. vbs
Line: 10
Char: 22
Error: Expected ')'
Code: 800A03EE
Source: Microsoft VBScript compilation error
-------------------------- -
OK
-------------------------- -
--------------------------
Windows Script Host
--------------------------
Script: C:\Documents and Settings\sharathr\Desktop\
Line: 10
Char: 22
Error: Expected ')'
Code: 800A03EE
Source: Microsoft VBScript compilation error
--------------------------
OK
--------------------------
Ooops, cut and paste problem, change this line
objIE.Document.ALL(""btnLo adDefaults "").Click
to this:
objIE.Document.ALL("btnLoa dDefaults" ).Click
Rob.
objIE.Document.ALL(""btnLo
to this:
objIE.Document.ALL("btnLoa
Rob.
ASKER
Rob i get this...
-------------------------- -
Windows Script Host
-------------------------- -
Script: C:\Documents and Settings\sharathr\Desktop\ Timesheet. vbs
Line: 10
Char: 1
Error: Object required: 'objIE.Document.ALL(...)'
Code: 800A01A8
Source: Microsoft VBScript runtime error
-------------------------- -
OK
-------------------------- -
I know without you seeing what it is its difficult to do it....
--------------------------
Windows Script Host
--------------------------
Script: C:\Documents and Settings\sharathr\Desktop\
Line: 10
Char: 1
Error: Object required: 'objIE.Document.ALL(...)'
Code: 800A01A8
Source: Microsoft VBScript runtime error
--------------------------
OK
--------------------------
I know without you seeing what it is its difficult to do it....
Hmmmm, yeah.....you may have to replace the
objie.Document.ALL(""btnLo adDefaults "").Click
bit with something like
objIE.Document.timesheefor m.btnLoadD efaults.Cl ick
but I'm not sure what the "timesheetform" form name actually is....I'll have another look tomorrow....
Regards,
Rob.
objie.Document.ALL(""btnLo
bit with something like
objIE.Document.timesheefor
but I'm not sure what the "timesheetform" form name actually is....I'll have another look tomorrow....
Regards,
Rob.
ASKER
Ok Rob
Now i get this.
-------------------------- -
Windows Script Host
-------------------------- -
Script: C:\Documents and Settings\sharathr\Desktop\ Timesheet. vbs
Line: 10
Char: 1
Error: Object doesn't support this property or method: 'objIE.Document.timesheefo rm'
Code: 800A01B6
Source: Microsoft VBScript runtime error
-------------------------- -
OK
-------------------------- -
In the Source
the first button to be clicked is this
basis" text="Make Default" type="submit" />
<input name="btnLoadDefaults" id="btnLoadDefaults" type="submit" class="greybtn_big" onMouseOut="this.className ='greybtn_ big';" title="Loads the timecard(s) detail set as default into the
Now i get this.
--------------------------
Windows Script Host
--------------------------
Script: C:\Documents and Settings\sharathr\Desktop\
Line: 10
Char: 1
Error: Object doesn't support this property or method: 'objIE.Document.timesheefo
Code: 800A01B6
Source: Microsoft VBScript runtime error
--------------------------
OK
--------------------------
In the Source
the first button to be clicked is this
basis" text="Make Default" type="submit" />
<input name="btnLoadDefaults" id="btnLoadDefaults" type="submit" class="greybtn_big" onMouseOut="this.className
Hmmm, what about this:
objIE.document.getElementB yId('ifram e_time_ent ry').btnLo adDefaults .Click
or this
objIE.top.frames['iframe_t ime_entry' ].document .all.btnLo adDefaults .Click
or this
objIE.top.frames['iframe_t ime_entry' ].btnLoadD efaults.Cl ick
Regards,
Rob.
objIE.document.getElementB
or this
objIE.top.frames['iframe_t
or this
objIE.top.frames['iframe_t
Regards,
Rob.
ASKER
I get this Rob for all the 3
-------------------------- -
Windows Script Host
-------------------------- -
Script: C:\Documents and Settings\sharathr\Desktop\ Timesheet. vbs
Line: 10
Char: 1
Error: Object required: ''iframe_time_entry''
Code: 800A01A8
Source: Microsoft VBScript runtime error
-------------------------- -
OK
-------------------------- -
--------------------------
Windows Script Host
--------------------------
Script: C:\Documents and Settings\sharathr\Desktop\
Line: 10
Char: 1
Error: Object required: ''iframe_time_entry''
Code: 800A01A8
Source: Microsoft VBScript runtime error
--------------------------
OK
--------------------------
ASKER
Any help with these.
https://www.experts-exchange.com/questions/22856113/Script-to-get-the-Mailbox-name-and-the-total-size-of-each-folder-in-the-mailbox.html?cid=239&anchorAnswerId=19972993#a19972993
https://www.experts-exchange.com/questions/22855708/Script-to-find-where-all-the-logged-in-user-is-a-member-in-his-local-machine.html
https://www.experts-exchange.com/questions/22847119/Hta-File-to-create-contacts-Groups-only.html
https://www.experts-exchange.com/questions/22856113/Script-to-get-the-Mailbox-name-and-the-total-size-of-each-folder-in-the-mailbox.html?cid=239&anchorAnswerId=19972993#a19972993
https://www.experts-exchange.com/questions/22855708/Script-to-find-where-all-the-logged-in-user-is-a-member-in-his-local-machine.html
https://www.experts-exchange.com/questions/22847119/Hta-File-to-create-contacts-Groups-only.html
What about:
objIE.document.frames['ifr ame_time_e ntry'].btn LoadDefaul ts.Click
you need to get the reference to the right object in the window.....
Regards,
Rob.
objIE.document.frames['ifr
you need to get the reference to the right object in the window.....
Regards,
Rob.
ASKER
I get this.
-------------------------- -
Windows Script Host
-------------------------- -
Script: C:\Documents and Settings\sharathr\Desktop\ Timesheet. vbs
Line: 10
Char: 1
Error: Object required: ''iframe_time_entry''
Code: 800A01A8
Source: Microsoft VBScript runtime error
-------------------------- -
OK
-------------------------- -
Rob
you need to get the reference to the right object in the window.....
How can i find this.
--------------------------
Windows Script Host
--------------------------
Script: C:\Documents and Settings\sharathr\Desktop\
Line: 10
Char: 1
Error: Object required: ''iframe_time_entry''
Code: 800A01A8
Source: Microsoft VBScript runtime error
--------------------------
OK
--------------------------
Rob
you need to get the reference to the right object in the window.....
How can i find this.
Hmmm, OK, try this:
'==============
strURL = "http://yoursite/time_sheet.htm"
Set objIE = CreateObject("InternetExpl orer.Appli cation")
objIE.Navigate strURL
objIE.Visible = True
While objIE.Busy
Wend
objIE.document.frames("ifr ame_time_e ntry").doc ument.all. btnLoadDef aults.Clic k
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltSTHrs.V alue = "9"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltSTMins. Value = "0"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltETHrs.V alue = "17"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltETMins. Value = "0"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. btnSaveSet tings.Clic k
Set ObjIE = Nothing
'==============
Regards,
Rob.
'==============
strURL = "http://yoursite/time_sheet.htm"
Set objIE = CreateObject("InternetExpl
objIE.Navigate strURL
objIE.Visible = True
While objIE.Busy
Wend
objIE.document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
Set ObjIE = Nothing
'==============
Regards,
Rob.
ASKER
I get this ROb...
-------------------------- -
Windows Script Host
-------------------------- -
Script: C:\Documents and Settings\sharathr\Desktop\ Timesheet. vbs
Line: 10
Char: 1
Error: Access is denied.
Code: 80070005
Source: (null)
-------------------------- -
OK
-------------------------- -
Rob did you have time for the Users creation..
--------------------------
Windows Script Host
--------------------------
Script: C:\Documents and Settings\sharathr\Desktop\
Line: 10
Char: 1
Error: Access is denied.
Code: 80070005
Source: (null)
--------------------------
OK
--------------------------
Rob did you have time for the Users creation..
Whoa! Strange....do you need to log into the site first? Are you sure you have
strURL set exactly to what you would type in the address bar?
Rob.
strURL set exactly to what you would type in the address bar?
Rob.
ASKER
Rob i am just changing the Strurl to the website.
It opens the website after which i get the error.
Once it opens it has to first click the "Load the defaults"
Now when i ran it i got this.
-------------------------- -
Windows Script Host
-------------------------- -
Script: C:\Documents and Settings\sharathr\Desktop\ Timesheet. vbs
Line: 10
Char: 1
Error: Member not found.
Code: 80020003
Source: (null)
-------------------------- -
OK
-------------------------- -
It opens the website after which i get the error.
Once it opens it has to first click the "Load the defaults"
Now when i ran it i got this.
--------------------------
Windows Script Host
--------------------------
Script: C:\Documents and Settings\sharathr\Desktop\
Line: 10
Char: 1
Error: Member not found.
Code: 80020003
Source: (null)
--------------------------
OK
--------------------------
Try this....making sure to change strURL back to your site's URL....
Does it actually appear to click the button?
'=============
strURL = "http://yoursite/timesheet.htm"
Set objIE = CreateObject("InternetExpl orer.Appli cation")
objIE.Navigate strURL
objIE.Visible = True
While objIE.Busy
WScript.Sleep 100
Wend
WScript.Sleep 1000
objIE.document.frames("ifr ame_time_e ntry").doc ument.all. btnLoadDef aults.Clic k
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltSTHrs.V alue = "9"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltSTMins. Value = "0"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltETHrs.V alue = "17"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltETMins. Value = "0"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. btnSaveSet tings.Clic k
Set ObjIE = Nothing
'=============
Regards,
Rob.
Does it actually appear to click the button?
'=============
strURL = "http://yoursite/timesheet.htm"
Set objIE = CreateObject("InternetExpl
objIE.Navigate strURL
objIE.Visible = True
While objIE.Busy
WScript.Sleep 100
Wend
WScript.Sleep 1000
objIE.document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
Set ObjIE = Nothing
'=============
Regards,
Rob.
ASKER
Rob i get this...
-------------------------- -
Windows Script Host
-------------------------- -
Script: C:\Documents and Settings\sharathr\Desktop\ Timesheet. vbs
Line: 13
Char: 1
Error: Access is denied.
Code: 80070005
Source: (null)
-------------------------- -
OK
-------------------------- -
Any help with the User's and Mailbox creation...
Candru had directed me to some website where i could get the code .Can you please look into it and help me in tweaking it to my environment please...
--------------------------
Windows Script Host
--------------------------
Script: C:\Documents and Settings\sharathr\Desktop\
Line: 13
Char: 1
Error: Access is denied.
Code: 80070005
Source: (null)
--------------------------
OK
--------------------------
Any help with the User's and Mailbox creation...
Candru had directed me to some website where i could get the code .Can you please look into it and help me in tweaking it to my environment please...
That's strange. Why would access be dened? Does the page display? Can you do the above steps manually?
What if you comment out both of the "click" lines, and just leave the time values....do those boxes then display those times?
Regards,
Rob.
What if you comment out both of the "click" lines, and just leave the time values....do those boxes then display those times?
Regards,
Rob.
ASKER
Yes Rob the page opens after which i get this error...
I commented these 2 line.
'objIE.document.frames("if rame_time_ entry").do cument.all .btnLoadDe faults.Cli ck
'objIE.Document.frames("if rame_time_ entry").do cument.all .btnSaveSe ttings.Cli ck
I get this...
-------------------------- -
Windows Script Host
-------------------------- -
Script: C:\Documents and Settings\sharathr\Desktop\ Timesheet. vbs
Line: 14
Char: 1
Error: Access is denied.
Code: 80070005
Source: (null)
-------------------------- -
OK
-------------------------- -
I commented these 2 line.
'objIE.document.frames("if
'objIE.Document.frames("if
I get this...
--------------------------
Windows Script Host
--------------------------
Script: C:\Documents and Settings\sharathr\Desktop\
Line: 14
Char: 1
Error: Access is denied.
Code: 80070005
Source: (null)
--------------------------
OK
--------------------------
This is obviously some sort of security issue....I'm running this on my WinXP SP2 machine, with IE 6 with SP2.
Can you try it on the same, or even a Windows 2000 box? Perhaps the Enhanced Internet Security of your Windows 2003 box is preventing this from working?
Regards,
Rob.
Can you try it on the same, or even a Windows 2000 box? Perhaps the Enhanced Internet Security of your Windows 2003 box is preventing this from working?
Regards,
Rob.
ASKER
Hi Rob...I just tested in a Xp machine also the same error is coming...
ASKER
First can the code just click. (Load defaults)
After this we can try the Hrs...
After this we can try the Hrs...
None of it will work without overcoming this Access Denied issue....it appears to be a "cross-frame" scripting issue with iFrames, security related, particularly, it seems, to a cross-domain reference....
I'm looking into it, but don't know much about it.....
Regards,
Rob.
I'm looking into it, but don't know much about it.....
Regards,
Rob.
ASKER
Ok Rob shall wait...Any help with the excel user creation...Q...
Sharath, both of these files that make up this website....are they in the same virtual folder on the webserver, or are they located on different webservers?
Rob.
Rob.
ASKER
Its on a single webserver Rob...
That's what I thought....very strange...I uploaded both of those file to the same folder on my webserver, and don't have a problem.....I'll keep looking....
Rob.
Rob.
Sharath, can you please try putting the URL address of your site for the time sheet into your "Trusted Sites" list in Tools --> Internet Options --> Security
Rob.
Rob.
ASKER
Rob now i dont get any error.
I am using this script.
'=============
strURL = "http://Sitename
Set objIE = CreateObject("InternetExpl orer.Appli cation")
objIE.Navigate strURL
objIE.Visible = True
While objIE.Busy
WScript.Sleep 100
Wend
WScript.Sleep 1000
objIE.document.frames("ifr ame_time_e ntry").doc ument.all. btnLoadDef aults.Clic k
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltSTHrs.V alue = "9"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltSTMins. Value = "0"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltETHrs.V alue = "17"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltETMins. Value = "0"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. btnSaveSet tings.Clic k
Set ObjIE = Nothing
'=============
It just opens the page but no click or does not click the Load defaults button...
I am using this script.
'=============
strURL = "http://Sitename
Set objIE = CreateObject("InternetExpl
objIE.Navigate strURL
objIE.Visible = True
While objIE.Busy
WScript.Sleep 100
Wend
WScript.Sleep 1000
objIE.document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
Set ObjIE = Nothing
'=============
It just opens the page but no click or does not click the Load defaults button...
Hmmm, so we're getting closer.....if you run this:
'===============
strURL = "http://members.optusnet.com.au/lisaquinlivan/time_entry/timesheet.htm"
Set objIE = CreateObject("InternetExpl orer.Appli cation")
objIE.Navigate strURL
objIE.Visible = True
While objIE.Busy
WScript.Sleep 100
Wend
WScript.Sleep 1000
'objIE.Document.frames("if rame_time_ entry").do cument.all .btnLoadDe faults.Cli ck
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltSTHrs.V alue = "12"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltSTMins. Value = "30"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltETHrs.V alue = "14"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltETMins. Value = "30"
'objIE.Document.frames("if rame_time_ entry").do cument.all .btnSaveSe ttings.Cli ck
Set ObjIE = Nothing
'===============
It won't click the buttons, but does it at least change the times to 12:30 and 14:30?
Rob.
'===============
strURL = "http://members.optusnet.com.au/lisaquinlivan/time_entry/timesheet.htm"
Set objIE = CreateObject("InternetExpl
objIE.Navigate strURL
objIE.Visible = True
While objIE.Busy
WScript.Sleep 100
Wend
WScript.Sleep 1000
'objIE.Document.frames("if
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
'objIE.Document.frames("if
Set ObjIE = Nothing
'===============
It won't click the buttons, but does it at least change the times to 12:30 and 14:30?
Rob.
ASKER
Yes Rob it has changed the Time...
OK, good....so it's working.....so, if you try again, uncomment those, or maybe have to wait for the LoadDefaults to work....try this:
'===============
strURL = "http://members.optusnet.com.au/lisaquinlivan/time_entry/timesheet.htm"
Set objIE = CreateObject("InternetExpl orer.Appli cation")
objIE.Navigate strURL
objIE.Visible = True
While objIE.Busy
WScript.Sleep 100
Wend
WScript.Sleep 1000
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. btnLoadDef aults.Clic k
While objIE.Busy
WScript.Sleep 100
Wend
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltSTHrs.V alue = "12"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltSTMins. Value = "30"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltETHrs.V alue = "14"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltETMins. Value = "30"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. btnSaveSet tings.Clic k
While objIE.Busy
WScript.Sleep 100
Wend
Set ObjIE = Nothing
'===============
Regards,
Rob.
'===============
strURL = "http://members.optusnet.com.au/lisaquinlivan/time_entry/timesheet.htm"
Set objIE = CreateObject("InternetExpl
objIE.Navigate strURL
objIE.Visible = True
While objIE.Busy
WScript.Sleep 100
Wend
WScript.Sleep 1000
objIE.Document.frames("ifr
While objIE.Busy
WScript.Sleep 100
Wend
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
While objIE.Busy
WScript.Sleep 100
Wend
Set ObjIE = Nothing
'===============
Regards,
Rob.
ASKER
Rob do you want me to try with this link
"http://members.optusnet.com.au/lisaquinlivan/time_entry/timesheet.htm"
Or my link?
In your link i get as
Method Not Allowed
The requested method POST is not allowed for the URL /lisaquinlivan/time_entry/ time_entry .aspx.
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
Apache/1.3.27 Server at members.optusnet.com.au Port 80
With my link i get it to just change the time but load defaults button is not clicking...
"http://members.optusnet.com.au/lisaquinlivan/time_entry/timesheet.htm"
Or my link?
In your link i get as
Method Not Allowed
The requested method POST is not allowed for the URL /lisaquinlivan/time_entry/
--------------------------
Apache/1.3.27 Server at members.optusnet.com.au Port 80
With my link i get it to just change the time but load defaults button is not clicking...
Oh yeah, sorry, that was my site.....Optusnet won't allow me to run asp code, so the Load Defaults doesn't work......
I'm surprised it's not clicking the button for your site......I'll have another look at it tomorrow.....
Regards,
Rob.
I'm surprised it's not clicking the button for your site......I'll have another look at it tomorrow.....
Regards,
Rob.
Sharath, try this, again changing strURL:
'=========
strURL = "http://yoursite/timesheet.htm"
Set objIE = CreateObject("InternetExpl orer.Appli cation")
objIE.Navigate strURL
objIE.Visible = True
While objIE.Busy
WScript.Sleep 100
Wend
WScript.Sleep 1000
'objIE.Document.frames("if rame_time_ entry").do cument.all .btnLoadDe faults.cli ck()
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. save_defau lts.value = 1
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltSTHrs.V alue = "12"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltSTMins. Value = "30"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltETHrs.V alue = "14"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltETMins. Value = "30"
'objIE.Document.frames("if rame_time_ entry").do cument.all .btnSaveSe ttings.cli ck()
Set ObjIE = Nothing
'=========
If that doesn't work, I'm wondering if you uncomment the .click lines again, if they work this time, just because of the brackets on the end....
What version of which browser are you using?
Regards,
Rob.
'=========
strURL = "http://yoursite/timesheet.htm"
Set objIE = CreateObject("InternetExpl
objIE.Navigate strURL
objIE.Visible = True
While objIE.Busy
WScript.Sleep 100
Wend
WScript.Sleep 1000
'objIE.Document.frames("if
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
'objIE.Document.frames("if
Set ObjIE = Nothing
'=========
If that doesn't work, I'm wondering if you uncomment the .click lines again, if they work this time, just because of the brackets on the end....
What version of which browser are you using?
Regards,
Rob.
Or even this:
'============
strURL = "http://yoursite/timesheet.htm"
Set objIE = CreateObject("InternetExpl orer.Appli cation")
objIE.Navigate strURL
objIE.Visible = True
While objIE.Busy
WScript.Sleep 100
Wend
WScript.Sleep 1000
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. btnLoadDef aults.fire Event("onC lick")
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. save_defau lts.value = 1
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltSTHrs.V alue = "12"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltSTMins. Value = "30"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltETHrs.V alue = "14"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltETMins. Value = "30"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. btnSaveSet tings.fire Event("onC lick")
Set ObjIE = Nothing
'============
Regards,
Rob.
'============
strURL = "http://yoursite/timesheet.htm"
Set objIE = CreateObject("InternetExpl
objIE.Navigate strURL
objIE.Visible = True
While objIE.Busy
WScript.Sleep 100
Wend
WScript.Sleep 1000
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
Set ObjIE = Nothing
'============
Regards,
Rob.
ASKER
I tried all the 3 ways but none cam up.
I have Ie 7.0 installed.
The last one changed the time and was the same .The other ones used to change as you defined and come back to normal
I have Ie 7.0 installed.
The last one changed the time and was the same .The other ones used to change as you defined and come back to normal
Is there any chance you could try this on IE6?
Rob.
Rob.
ASKER
Rob i check in a ie 6 machine also but it does not click the Defaults button
Sharath, can you try this:
'============
strURL = "http://yoursite/timesheet.htm"
Set objIE = CreateObject("InternetExpl orer.Appli cation")
objIE.Navigate strURL
objIE.Visible = True
While objIE.Busy
WScript.Sleep 100
Wend
WScript.Sleep 10000
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. btnLoadDef aults.clic k
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltSTHrs.V alue = "9"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltSTMins. Value = "00"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltETHrs.V alue = "17"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltETMins. Value = "00"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. btnSaveSet tings.clic k
Set ObjIE = Nothing
'============
All I did here was increase the Sleep time to 10 seconds.....
I have had the opportunity to upload it to another site, which happened to be much slower.
As a result, I have realised that even though we have the
While objIE.Busy
part, this doesn't account for the extra load time of the iFrame documents. So I increased the wait to 10 seconds, which was more than enough time, and then the button got clicked.....
Fingers crossed....
Regards,
Rob.
'============
strURL = "http://yoursite/timesheet.htm"
Set objIE = CreateObject("InternetExpl
objIE.Navigate strURL
objIE.Visible = True
While objIE.Busy
WScript.Sleep 100
Wend
WScript.Sleep 10000
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
Set ObjIE = Nothing
'============
All I did here was increase the Sleep time to 10 seconds.....
I have had the opportunity to upload it to another site, which happened to be much slower.
As a result, I have realised that even though we have the
While objIE.Busy
part, this doesn't account for the extra load time of the iFrame documents. So I increased the wait to 10 seconds, which was more than enough time, and then the button got clicked.....
Fingers crossed....
Regards,
Rob.
ASKER
I get this .
-------------------------- -
Windows Script Host
-------------------------- -
Script: C:\Documents and Settings\sharathr\Desktop\ Timesheet. vbs
Line: 14
Char: 1
Error: Object doesn't support this property or method: 'objIE.Document.frames(... ).Document .all.btnLo adDefaults '
Code: 800A01B6
Source: Microsoft VBScript runtime error
-------------------------- -
OK
-------------------------- -
--------------------------
Windows Script Host
--------------------------
Script: C:\Documents and Settings\sharathr\Desktop\
Line: 14
Char: 1
Error: Object doesn't support this property or method: 'objIE.Document.frames(...
Code: 800A01B6
Source: Microsoft VBScript runtime error
--------------------------
OK
--------------------------
Huh, that seems to be a backwards step! Did you make sure strURL was right?
I'll come back on Monday for another go!
Rob.
I'll come back on Monday for another go!
Rob.
ASKER
URL is correct...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Now the load defaults is working
Now next it has to click"L2 Support" Hyperlink and change the time to total 9.00 and "Save and close"
Now next it has to click"L2 Support" Hyperlink and change the time to total 9.00 and "Save and close"
OK cool. Where is the "L2 Support" hyperlink? Is it on another page that I don't have?
If you look in the source for that page, and search for
L2 Support
can you tell me what the href value is for that hyperlink? I need to know whether it runs a function, or just loads another page....
Also, for that same hyperlink, where the href is, does it have an "id" tag, or a "name" tag? I'm concerned we won't be able to "click" a hyperlink programmatically....
Regards,
Rob.
If you look in the source for that page, and search for
L2 Support
can you tell me what the href value is for that hyperlink? I need to know whether it runs a function, or just loads another page....
Also, for that same hyperlink, where the href is, does it have an "id" tag, or a "name" tag? I'm concerned we won't be able to "click" a hyperlink programmatically....
Regards,
Rob.
ASKER
Thanks a lot Rob for all the help...
I think the above script is ok... As i had a option there where i can save all the details.When load defaults is selected all is done.
I think the above script is ok... As i had a option there where i can save all the details.When load defaults is selected all is done.
OK fair enough. I just got something working though I think....you can try this if you want:
'===============
strURL = "http://yoursite/timesheet.htm"
Set objIE = CreateObject("InternetExpl orer.Appli cation")
objIE.Navigate strURL
objIE.Visible = True
While objIE.ReadyState <> 4
WScript.Sleep 100
Wend
'objIE.Document.frames("if rame_time_ entry").do cument.all .btnLoadDe faults.Cli ck
While objIE.ReadyState <> 4
WScript.Sleep 100
Wend
'Source: https://www.experts-exchange.com/questions/22045830/VBA-to-open-web-page-find-text-and-click-on-text's-URL-link.html
Set colATags = objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. tags("A")
For intHRef = 0 To colATags.Length
If InStr(colATags.Item(intHRe f).InnerHT ML, "L2 Support") > 0 Then
colATags.Item(intHRef).Cli ck
Exit For
End If
Next
While objIE.ReadyState <> 4
WScript.Sleep 100
Wend
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltSTHrs.V alue = "12"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltSTMins. Value = "30"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltETHrs.V alue = "14"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. sltETMins. Value = "30"
objIE.Document.frames("ifr ame_time_e ntry").doc ument.all. btnSaveSet tings.Clic k
While objIE.ReadyState <> 4
WScript.Sleep 100
Wend
Set objIE = Nothing
MsgBox "Done"
'===============
Regards,
Rob.
'===============
strURL = "http://yoursite/timesheet.htm"
Set objIE = CreateObject("InternetExpl
objIE.Navigate strURL
objIE.Visible = True
While objIE.ReadyState <> 4
WScript.Sleep 100
Wend
'objIE.Document.frames("if
While objIE.ReadyState <> 4
WScript.Sleep 100
Wend
'Source: https://www.experts-exchange.com/questions/22045830/VBA-to-open-web-page-find-text-and-click-on-text's-URL-link.html
Set colATags = objIE.Document.frames("ifr
For intHRef = 0 To colATags.Length
If InStr(colATags.Item(intHRe
colATags.Item(intHRef).Cli
Exit For
End If
Next
While objIE.ReadyState <> 4
WScript.Sleep 100
Wend
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
objIE.Document.frames("ifr
While objIE.ReadyState <> 4
WScript.Sleep 100
Wend
Set objIE = Nothing
MsgBox "Done"
'===============
Regards,
Rob.
ASKER
Thanks Rob... Any help with the Excel user creation part...
Yeah, I've been busy...sorry....I'll try to have a look tomorrow afternoon....I have a four hour training session in the morning....
Rob.
Rob.
ASKER
Ok Rob...Thanks...
Can you please provide more information? Your question as it stands is a little vague.
Regards,
Wayne