Using ADODB Efficiently

S

Simon

Hi,

I have an excel worksheet where a number of cells use a UDF to retrieve data
from an access database, the UDF uses ADODB to communicate to the database.
When the spreadsheet updates the formulas it takes quite a while to calculate
the cells I think its because for each cell that contain the UDF, the UDF
creates a new connection to the database is there a more efficient way of
doing this maybe re-using the one connection?

Thanks.
Simon
 
B

Bob Phillips

Save the connection as a static object variable in the UDF and test if it is
nothing or not (set connection if so), or as a module level variable and do
likewise.
 

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