VBA to get current exchange rate from TD Bank website

L

Legacy 185660

Guest
Hi!

I'm looking for some way to grab the current US DOLLARS "Client Buys" rate from TD Canada Trust - Banking - Foreign Currency Services.

When I import using the data tab, I can't get the values to show up. Through skimming the source code of the site, I was able to find where the values are located:

Code:
nations = new Array('US DOLLARS','CANADIAN DOLLARS','US BORDERLESS PLAN','POUND STERLING','AUSTRALIA DOLLAR','BARBADOS DOLLAR','CZECH KORUNA','DANISH KRONER','E CARIBBEAN DOLL','EURO','HONG KONG DOLLAR','INDIAN RUPEE','JAPANESE YEN','MEXICAN PESO','NEW ZEALAND','NORWEGIAN KRONE','PAKISTAN RUPEE','PHILIPPINES PESO','SAUDI RIYAL','SINGAPORE DOLLAR','S. AFRICAN RAND','SWEDISH KRONA','SWISS FRANC','U.A.E DIRHAM','POLISH ZLOTY','HUNGARIAN FORINT'); 
sellToCAD = new Array( 1.0106, 1.0000, 1.0224, 1.5241, 0.9294, "N/A", "N/A", 0.1745, "N/A", 1.3242, 0.1296, "N/A", 0.010096, "N/A", 0.7961, 0.1659, "N/A", "N/A", 0.2608, 0.7966, "N/A", 0.1525, 1.0728, "N/A", "N/A", "N/A"); 
buyFromCAD  = new Array( 1.0658, 1.0000, 1.0540, 1.6175, 0.9892, 0.5544, 0.0554, 0.1915, 0.4129, 1.4056, 0.1382, 0.0182, 0.010844, 0.0876, 0.8421, 0.1804, 0.0114, 0.0246, 0.2928, 0.8536, 0.1146, 0.1621, 1.1348, 0.2962, 0.3413, 0.004991);

What I want is sellToCAD[1], but I have no idea how to get that.

Off the top of my head, what I'm thinking is that I can grab the source code of the page and search it with VBA, but I'd rather not do it that way as it would be a bit slow. Any of you have any better ideas?
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,216,099
Messages
6,128,813
Members
449,469
Latest member
Kingwi11y

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