« first day (28 days earlier)    last day (15 days later) » 

3:35 PM
@Qharr
Hi there !!
 
4:10 PM
hello
 
Hi there !!
 
:-)
wassup?
ttyl
 
4:34 PM
Sorry !!
I have successfully completed a project in Selenium using VBA !!
I need your expertise assistance to check the code and see for any flaw!! Just to let you know the code works fine !!
@QHarr
Sub Praise_the_LORD()
Dim E As Long
Dim Emp As Long
Dim U As Long
Dim CBTmidc As Long
Dim S As Long
Dim Y As Variant
Dim X As Variant
Dim Z As Variant
Dim Lastrow As Long
Dim bot As New WebDriver, keys As New Selenium.keys
Dim rrnngg As Variant
Dim stdate As Variant
Dim eddate As Variant
Dim Accvalu As Long
Dim CurrentPage As Variant

ActiveWorkbook.Unprotect "JESuS"
Sheets("Data").Select
Range("E2").Select
E = Range("A" & Rows.Count).End(xlUp).Row - 5
U = Range("M" & Rows.Count).End(xlUp).Row
Emp = WorksheetFunction.CountBlank(Range("L6:M" & U))
@QHarr
 
5:05 PM
Ok.. so there is a fair amount of code there.
 
Yeah !!
 
First thing I notice is all those GoTos..... you really want to avoid those where possible.
Remind me.... can you see the upload button over here? >>>>>>>>>>>
 
No I do not see it !!
 
U c it?
 
May be my ranking is low !!
 
5:08 PM
When you paste code into this window there should appear a format button >>>>>>
It formats your code properly when you paste in here.
Just so you know. Someone had to tell me only last week.
 
I tried doing it but it did not work !!
Please wait let me try something !!
 
Public Sub MyFormattedCode()
    Debug.Print "This is indented"
End Sub
 
Sub To_extract()
        Dim E As Long
        Dim Emp As Long
        Dim U As Long
        Dim CBTmidc As Long
        Dim S As Long
        Dim Y As Variant
        Dim X As Variant
        Dim Z As Variant
        Dim Lastrow As Long
        Dim bot As New WebDriver, keys As New Selenium.keys
        Dim rrnngg As Variant
        Dim stdate As Variant
        Dim eddate As Variant
        Dim Accvalu As Long
        Dim CurrentPage As Variant

        ActiveWorkbook.Unprotect "JESuS"
        Sheets("Data").Select
Check if this is okay !!
 
There you go!
 
Also I need your help to access a different portal !!
 
5:15 PM
@David Write an MCVE on SO for the portal question. Remember to include the vba attempt, HTML using snippet tool....
Your code above: So, I will need to spend some time looking at it. I can already see GoTos that should be removed if possible, With statements should be used a lot more, .Active/.Select should be removed where possible
Also, you use a lot of explicit waits with Application.Wait.... rather than using the explicit waits available via selenium.
Avoid using ActiveCell where possible and loop arrays.
 
@David Write an MCVE on SO for the portal question. Remember to include the vba attempt, HTML using snippet tool....
Sorry I cannot understand the above statement !!
 
Use meaningful variable names i.e. not rrnngg
 
Got it !!
Also, you use a lot of explicit waits with Application.Wait.... rather than using the explicit waits available via selenium.

For the above. Is there any difference between both methods ?
Avoid using ActiveCell where possible and loop arrays.
Sure, point noted !!
 
@David If you are stuck with a new programming problem for logging into a portal prepare a MCVE stackoverflow.com/help/mcve ; post on Stackoverflow and ping me. Make sure you include the html using the snippet tool (not as an image) and your VBA attempts so far.
@David If you use the explicit wait with selenium if something is found sooner the code will run faster. The other explicit wait will always wait the alloted time.
Selenium explicit wait is a max as opposed to the absolute.
 
Oh that is really great !! I will really use that !!
 
5:24 PM
I will have a look at the rest of your code during tomorrow.
 
Sure !!
Let me post the other question and get you the link !
 
Ok.. be sure to include your vba attempt, html ......you know the routine! And does the portal have an URL we can use? (I suspect not!)
 
Sure !! I can share the portal URL as the issue happens in the beginning itself !!
The username input box is inside a frame tag so i tried the below code but it does not work !!
bot.SwitchToFrame .FindElementByTag("frame").SendKeys Y
 
The luxury of an URL wonderful.
 
5:40 PM
I am so stupid, the code i used form the example you shared me earlier had a WIth statement, I am looking at it and I tried the below code it works !!
With bot
.SwitchToFrame .FindElementByTag("frame")
.FindElementByName("input-username").SendKeys "User"
End With
Really GOD !! I must learn to read first !!
But i have doubt, why it works only when using With statement ?
 
5:59 PM
@QHarr
 
awesome!
 
6:22 PM
Thank you !!
 

« first day (28 days earlier)    last day (15 days later) »