The highlighting of the table is disabled because this page uses the compatibility mode of Internet Explore

Corried

Board Regular
Joined
Dec 19, 2019
Messages
217
Office Version
  1. 2019
Platform
  1. Windows
  2. Web
Hello Excel Pros, around the World.

I have a problem>

I am trying to login my portfolio by signing my email and password to access data tables from in investing.com website.

I created a short video that shows my current problem. If you are open in helping me. It would be greatly appreciated.


In video time 1:39, a yellow bar indicates "The highlighting of the table is disabled because this page uses the compatibility mode of Internet Explorer". you will also find that the web page does not display properly.

Base the information provided.

How can I work around this?


Thanks in advance

Cheers

https://drive.google.com/file/d/1nywatn ... sp = sharing
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
I did it with VBA:

VBA Code:
Public driver As New ChromeDriver

Sub Corr()
Dim pt As WebElement, i%, tx$, j%, k%
Cells.ClearContents                                                         ' Clear sheet <===
driver.get "https://www.investing.com/portfolio/"
Application.Wait Now + TimeValue("0:00:03")
Set pt = driver.FindElementByXPath("//*[@id=""loginFormUser_email""]").SendKeys(CStr(Sheets("test").[a85]))
Set pt = driver.FindElementByXPath("//*[@id=""loginForm_password""]").SendKeys(CStr(Sheets("test").[a86]))
Set pt = driver.FindElementByXPath("//*[@id=""signup""]/a")
pt.Click
Application.Wait Now + TimeValue("0:00:03")
Set pt = driver.FindElementByXPath("//*[@id=""navMenu""]/ul/li[9]/a")
pt.Click
Set pt = driver.FindElementByXPath("//*[@id=""portfolioData_10987384""]/div/table") ' get table
j = 1
For i = 1 To pt.FindElementsByTag("tr")(1).FindElementsByTag("th").Count    ' table header
    Cells(1, j) = pt.FindElementsByTag("tr")(1).FindElementsByTag("th")(i).Text
    j = j + 1
Next
For i = 2 To pt.FindElementsByTag("tr").Count                               ' table rows
    j = 1
    For k = 1 To pt.FindElementsByTag("tr")(i).FindElementsByTag("td").Count    ' columns
        Cells(i, j) = pt.FindElementsByTag("tr")(i).FindElementsByTag("td")(k).Text
        j = j + 1
    Next
Next
For i = Cells(1, Columns.Count).End(xlToLeft).Column To 1 Step -1
    If WorksheetFunction.CountA(Columns(i)) = 0 Then Columns(i).Delete Shift:=xlToLeft
Next
[a1].CurrentRegion.NumberFormat = "0.0000"
End Sub
 
Upvote 0
Hello Worf

Thank you for reaching out to me. I really appreciate it.

Wow. I can't believe it. I thought to myself this could not be done. However, I am not sure if I have done something wrong as I am getting an error message when I try to run macros.
Please view file below...

How do you want me to proceed? and What do you want me to do to fix the issues that I am having?

Thanks in advance Worf.

Hear from you soon
 

Attachments

  • VBA.PNG
    VBA.PNG
    56.5 KB · Views: 132
Upvote 0
  • The first problem is easy to fix, just delete that line that says “VBA code”.
  • The other thing is that you need to install the Chrome driver, see post #4 of thread below for instructions…

 
Upvote 0
  • The first problem is easy to fix, just delete that line that says “VBA code”.
  • The other thing is that you need to install the Chrome driver, see post #4 of thread below for instructions…
There Worf I have followed your instruction to the letter and I was surprise that your recommendation have worked and excel macros have opened a second chrome icon in the taskbar on my computer. Please view the photo below that label "2nd".

However, Excel macro have and error of some sort. Please view photo below that label error.

With your help, I can see the end result...

Thanks in advance
 

Attachments

  • 2nd.PNG
    2nd.PNG
    189.8 KB · Views: 72
  • error.PNG
    error.PNG
    61 KB · Views: 74
Upvote 0
Congratulations, you are now automating Chrome from Excel...

The code expects a sheet named test with the email and password at cells A85 and A86.

You can do it like that or change the code to a sheet and cell locations of your preference.
 
Upvote 0
Congratulations, you are now automating Chrome from Excel...
I am ready to pop the champagne until all are present for the celebration party. But Apparently:
"Set pt = driver.FindElementByXPath("//*[@id=""portfolioData_10987384""]/div/table") ' get table"
is not on board and not ready for the party.

I,m getting an error message that says and the email and password disappear when I press the macro button.

Please view below images.

Thanks in advance
 

Attachments

  • 1.PNG
    1.PNG
    85.7 KB · Views: 36
  • 2.PNG
    2.PNG
    115.1 KB · Views: 39
Upvote 0
Can you confirm what code line gets highlighted when the debug button is pressed?

What does the Chrome window display at this point? I can see part of it and it is complaining about the email address.
 
Upvote 0
What does the Chrome window display at this point?
Please view photos below as it worth a 1000 words. However, email & Password Disappeared after macros was started.

Thanks in advance
 

Attachments

  • Error 7.PNG
    Error 7.PNG
    193.9 KB · Views: 30
  • error 7 Yellow.PNG
    error 7 Yellow.PNG
    197.5 KB · Views: 29
Upvote 0
The code stopped when it was supposed to find the table, so it probably performed the previous actions successfully, including the login step.

At that point you should see something similar to the page below, I will proceed based on these assumptions.

Feel free to provide more information about your testing if necessary.

port.PNG
 
Upvote 0

Forum statistics

Threads
1,215,273
Messages
6,123,984
Members
449,137
Latest member
abdahsankhan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top