ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Set cnn = New ADODB.Connection (https://www.excelbanter.com/excel-programming/424207-set-cnn-%3D-new-adodb-connection.html)

burl_h

Set cnn = New ADODB.Connection
 
I'm having issues with this line of code.

Currently it works fine in excel 2003. however after the file is used
in excel 2007 and saved in compatability mode, it no longer works in
excel 2003. Am I missing some object libaries?

thanks
burl_h

Bob Phillips[_3_]

Set cnn = New ADODB.Connection
 
Maybe, you should have a reference to the Microsoft ActiveX Data Object n.n
Library.

--
__________________________________
HTH

Bob

"burl_h" wrote in message
...
I'm having issues with this line of code.

Currently it works fine in excel 2003. however after the file is used
in excel 2007 and saved in compatability mode, it no longer works in
excel 2003. Am I missing some object libaries?

thanks
burl_h




Mike

Set cnn = New ADODB.Connection
 
What are you connecting to ?

"burl_h" wrote:

I'm having issues with this line of code.

Currently it works fine in excel 2003. however after the file is used
in excel 2007 and saved in compatability mode, it no longer works in
excel 2003. Am I missing some object libaries?

thanks
burl_h


burl_h

Set cnn = New ADODB.Connection
 
Mike/Bob,

I narrowed the issue down to a missing libary. It appears that when
the file is saved with excel 2007 (in compatability mode) then opened
in excel 2003 it shows that the Microsoft Outlook 12.0 object libary
is missing. I changed this to object libary 11.0 and the macro runs
fine in excel 2003. After I save the file in excel 2003 then re-open
the file using excel 2007 the object libary changes back to 12.0, the
macro runs without issue.

So the problem appears to be how excel 2007 and 2003 assign the
microsoft outlook object libaries, one wants 12.0 the other wants
11.0.

How can I overcome this?

Thanks
burl_h

Bob Phillips[_3_]

Set cnn = New ADODB.Connection
 
That is a perennial problem, why many of us just use late-binding.

--
__________________________________
HTH

Bob

"burl_h" wrote in message
...
Mike/Bob,

I narrowed the issue down to a missing libary. It appears that when
the file is saved with excel 2007 (in compatability mode) then opened
in excel 2003 it shows that the Microsoft Outlook 12.0 object libary
is missing. I changed this to object libary 11.0 and the macro runs
fine in excel 2003. After I save the file in excel 2003 then re-open
the file using excel 2007 the object libary changes back to 12.0, the
macro runs without issue.

So the problem appears to be how excel 2007 and 2003 assign the
microsoft outlook object libaries, one wants 12.0 the other wants
11.0.

How can I overcome this?

Thanks
burl_h





All times are GMT +1. The time now is 11:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com