Excel 2007 to 2010 Issue

GQue

New Member
Joined
Apr 13, 2011
Messages
34
Well, I have an issue with some code that works perfectly fine in Office 2007, but since I upgraded to Office 2010, the code now fails. Oddly, it fails when calling a Sub in my code and not at a specific area in the code.

Error messge:
The object invoked has disconnected from its clients
Now I read several blogs that talk about Option Explicit being required (it is in my code).

Only thing I can point out is the sub being called has an ADO DB Connection in it and it is the only location in the code that calls a DB connection.

Has anyone else had this issue? I can't understand why it works in 2007, but not in 2010.

Help pls! =)
 
As I mentioned earlier, this worked yesterday when I was using Office 2007.

So yes, the ODBC connection is setup in Admin Tools and the Reference for Microsoft ActiveX Data Objects 2.8 Library is checked under References.

This has been in production, running every morning for 3 months without a single error while I was using Office 2007.

I do apologize if I sound snippy... I greatly appreciate your time! Just frustrated that MS has screwed me up yet again without a single note to say this may happen.

If I had the option, I would happily move back to Office 2007, but the Outlook client in 2007 has issues with embedded images in the signature and Outlook 2010 doesn't but that was a nightmare that I already dealt with... =)
 
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
If you run the code from the VBE does it work?
As an aside, why are you opening and closing the same connection inside your loops? Why not open it once outside the loop, then deal with the data and then close it again?
 
Upvote 0
No... I get the same error in the VBE.

And just never got back around to cleaning up the code... I have a snippet library that I pull from for common functions, so it was laziness. =)

Thanks for your reply RoryA
 
Upvote 0
If you comment out all the code in the called sub, does the error still occur?
 
Upvote 0
Good thought Rory... I didn't think of that, but as I suspected, it still caused the error.

I deleted out all the code in the SUB that is called so the only thing there was:
Code:
Sub ClearAcctManagers()
End Sub

Same error at the same spot in the code...
 
Upvote 0
If you comment out the call, does the code work or does it simply error at a later line?
 
Upvote 0
If you change the name of the sub (and adjust the calling routine) does it work?
 
Upvote 0
Tried that as well...

Originally it was just: ClearAM

Then I tried: Call ClearAM

Then: Call ClearAcctManagers

Then: ClearAcctManagers

=(
 
Upvote 0
Have you tried exporting, removing and reimporting the code module?
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,283
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top