Using excel add-ins in access

  • Thread starter Thread starter schetlur
  • Start date Start date
S

schetlur

I installed an addin for excel. I then created a simple form in an Access db
and in the code editor window, I went to Tools...References and picked the
add-in as a reference.

In the code, I'm trying to call the add in :

****
Dim MyStockQuote As MSNStockQuote.Functions
Set MyStockQuote = New MSNStockQuote.Functions

Me.txtStockQuote.Value = MyStockQuote.MSNStockQuote("MSFT", "Last", "US")
****

This is erroring out. When try to debug, the error number I get is 2015. The
text in the txtStockQuote is #Error.

Am I calling the add-in function right?
 
Hi,
put a stop on this line and then run in immediate window:

?MyStockQuote.MSNStockQuote("MSFT", "Last", "US")

perhaps it returns null, then you have to convert it to string as:

Me.txtStockQuote.Value = MyStockQuote.MSNStockQuote("MSFT", "Last", "US") &
""

--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com
 
Back
Top