Hi,
I am trying to build some code that extracts data from a few different databases using SQL queries. There are some tools that the company have put together to gather data and I am modifying them and compiling them into one workbook so i can extract the data combine it and then display it the way I want.

The problem I am having is that one database requires 'Microsoft Active X Data Objects 2.8 Library' enabled and the other gets a 'Type error 13' error when this is enabled.

Is there any way to disenable or enable references "mid code". I could run one extraction and then stop, change the settings and then run the other but I want it to be a one click exercise so others can use the sheets when its finished.

Thanks in advance