Using excel add-ins in access

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?
 
A

Alex Dybenko

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top