Changing ADO connections in VB because of Word upgrade?
I developed a Word template for someone almost 2 years ago (and therefore I can't remember much about how I did it now). Amongst other things the template accesses an Excel spreadsheet using an ADO connection.
The statement I use to set this up is:
.Provider = "Microsoft.ACE.OLEDB.12.0"
.ConnectionString = sConn
The template was used extensively with no problems until the person I developed it for decided to upgrade to Word 2013. During their testing to make sure everything was going to run okay, they encountered a Run-time error 80040e37. (see attached screen shot) As far as I know they were able to open a document based on the template, but they encountered this error when they tried to do particular functionality. I haven't been able to confirm this yet.
As my user and I are no longer in the same location, I copied his version of the template (to make sure we were using the same one), onto my laptop. Now when I try to create a document based on that template (by going to Word, clicking on New, and selecting the template) I am getting a Run-time error 80004005 (see attached screen shot). I have worked out that my run-time error is caused by the 'With cnt..." statement above.
Unfortunately, after 2 years, I can't remember how I worked out that the provider should be "Microsoft.ACE.OLEDB.12.0". I have gone into Tools, References and have scrolled down the list but could not find this reference. I did find a "Microsoft Access 14.0 Object Library" so I tried checking this and changing the version in the statement from 12.0 to 14.0, but no joy. (I got another error message and as I was clutching at straws I won't confuse the issue by noting it.)
I did find some instructions in a textbook that said to look for a reference starting with "Microsoft ActiveX Data Objects", and I did find a newer version of this (6.1 instead of 2.8) but checking on it doesn't seem to have made a difference (i.e I still get the same run-time errror).
As usual, I have got myself all confused.
I don't know if the two run-time errors are linked (e.g. my error is appearing because I'm running Windows 7 and not XP any more), and my user's error is caused because they've upgraded to Office 2013 (and possibly Windows 8? - I can check if I'm on the right track) or if it is a coincidence and they are totally unrelated.
Any help would be appreciated. At this stage, obviously I am trying to sort out my run-time error so I can see if I can run the template okay on my laptop. Once I've confirmed this, I'll go visit my user and confirm what he's doing.
Attachment 37684Attachment 37685