ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using Msnstockquote from excel VBA (https://www.excelbanter.com/excel-programming/366197-using-msnstockquote-excel-vba.html)

Gary

Using Msnstockquote from excel VBA
 
I am able to load a cell in an Excel spreadsheet with something like

=MSNStockQuote("msft","Last Price","US")

However, I would like to load a variable in a VBA module with something like;
curPrice = MSNStockQuote("msft","Last Price","US")
and I get €śVariable Not Defined€ť even though CurPrice is defined.

I also tried unsuccessfully with:
curPrice = MSNStockQuote.Functions.MSNStockQuote("msft", "Last Price", "US")

How do I call the MSNStockQuote function from within a VBA module ?

And is it possible to use this call to return more than one parameter at a
time.

Say I wanted Price and time of day as well. Can I do this with a single
Function call?

Thanks,

Gary



All times are GMT +1. The time now is 12:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com