Here. Coded and tested on Office for Mac 2011 MacOS Sierra.
Since Excel 2011 for Mac does not support the msxml2.xmlhttp or winhttp.winhttprequest.5.1 objects (for downloading of webpage), and does not support creating HTML/XML data objects (for manipulation of data)
and does not support regular expressions (wtf?) (for data extraction), this macro relies on two applications bundled with OSX: cURL (to download the page), and the Perl Interpreter (to extract data).
The command being run is as follows (+ explanation):
CODE
curl --silent --get -data "id=FUND_CODE_HERE" https://www.fundsupermart.com.my/main/fundinfo/dailyPricesHistory.tpl | perl -0777 -ne 'print "$1;$2" if /"a">.*?(\d+\.\d+).*?bdtext_style\W>(.*?)<\/td>/s'
curl: "See URL". Used to download pages/resources at a URL.
--silent: Does not print progress
--get: Uses HTTP GET to send the data specified in -d
-d: The data to send
"id=FUND_CODE_HERE": The "fund code" part of the URL
https://www.fundsupermart.com.my/main/fundinfo/dailyPricesHistory.tpl: The webpage
So this command downloads the webpage at
https://www.fundsupermart.com.my/main/fundinfo/dailyPricesHistory.tpl?id=FUND_CODE_HERE|: The "pipe" character. This sends the output of the first command to the second command.
perl: Run the Perl Interpreter. This is a program that can run codes in the Perl programming language.
-0777: Prevents line splitting (take all input and consider it as one line)
-n: Take previous output and take it into Perl line by line
-e: Execute the given command (in quotations, explained below)
At this stage, we've taken the downloaded page and dumped it into Perl for processing. The next step is to run Perl code/instructions to extract and manipulate the data.
print "$1;$2": Print the first extracted data ($1, this is the NAV), and second extracted data ($2, this is the date)
if: Run the "print" command if the next pattern matches
/"a">.*?(\d+\.\d+).*?bdtext_style\W>(.*?)<\/td>/s: This is the pattern (Regular Expression pattern), it just describes the text of the HTML file and extracts the NAV (\d+\.\d+) and date (.*?)