Hi
I am requesting a VBA to get vallue from
https://dhan.co/etf/motilal-oswal-mi...f-share-price/
by passing parameter MOM100 dhan.JPG
I am using Excel 2016
Hi
I am requesting a VBA to get vallue from
https://dhan.co/etf/motilal-oswal-mi...f-share-price/
by passing parameter MOM100 dhan.JPG
I am using Excel 2016
Do you know the exact URL for the stock you need a share price for or does that need to be calculated?
If the sheet contained a table sort of like:
![]()
Please Login or Register to view this content.
Okay here is some code that may help you.
You will need references to WinHTTP and HTML Object Library![]()
Please Login or Register to view this content.
Last edited by jdelano; 05-21-2025 at 05:48 AM.
If I change MOM to ACE it does not work
Did you change the name and the symbol? it converts the name (with spaces) to the url needed.
Yes I changed MOM and ACE it should work
Post a screenshot of the data you put in the sheet, please.
I use a website daily where I have an account and retrieve various data from it after I am automatically logged in. I use the Chrome browser for this in combination with Excel-VBA and SeleniumBasic-2.0.9.0.
All data can be read and sending username and password is also possible. If you are interested, I would like to help you.
Attached, the URL changes for this symbol and each symbol i canot change URl , by passing symbol I should be able to get the value
The style is different between the stock I tested with and the one you tried.
Changed the function that does the retrieving
![]()
Please Login or Register to view this content.
Hi
well, this works but when I have huge data, it is impossible to copy URL and paste for every line. Is it possible that I have only Column B and C and I input symbol in Column B to get data in Column C without any URL or name
You'll see in the comments that it can calc using the name
Can you please help me modifty to this URL
Bevause in this the URL does not change I have to only pass param MOM100
https://www.nseindia.com/get-quotes/...?symbol=MOM100
Then you'd do something like this
![]()
Please Login or Register to view this content.
I have made changes but it does not work
I don't have access to that link.
"Access Denied
You don't have permission to access "http://www.nseindia.com/get-quotes/equity?" on this server.
Reference #18.b20a3517.1748865148.29e0901
https://errors.edgesuite.net/18.b20a3517.1748865148.29e0901"
Go to the link https://www.nseindia.com/get-quotes/equity?symbol=ACE and then right click the page and select view source. Then find the HTML element names or styling that identifies where in the page the information you're interested in. It may be that the HTML layout for this URL is different from the first one you were attempting to use.
it is div.blkbox.whitetxt
<div class="blkbox-whitetxt">
<span id="quoteLtp" data-nse-translate="number" class="pe-2">1,259.30</span>
<span id="arrowInfoStatus" class="blkbox-greentxt" aria-label="quote value High">
<span class="rg-arrow"><span class="invisibleText">quote value High</span></span>
</span>
</div>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks