Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using ADODB Efficiently
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using ADODB Efficiently
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. -- __________________________________ HTH Bob "Simon" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I use a pivot table with this efficiently? | Excel Discussion (Misc queries) | |||
Efficiently Generate 88 Chartsheets | Excel Worksheet Functions | |||
How to efficiently declare variables | Excel Discussion (Misc queries) | |||
How to get 500 hyperlink address efficiently? | Excel Discussion (Misc queries) | |||
Getting data efficiently | Excel Programming |