Forum Discussion

mmaniscalco's avatar
mmaniscalco
Occasional Contributor
13 years ago

Cannot create Excel Driver after upgrading Office from 2007 to 2010

My company has just upgrade to Office 2010 and it force upgraded me last Thrusday.  Since the upgrade I have been unable to execute the following code to connect to an excel spreadsheet.



oReturn = DDT.ExcelDriver(strFile, strSheet, true); 



This code work fine the day before, so I'm assuming this is a configuration issue on my side with office.  I have confirmed that I do have Office 2010 32bit and not 64bit.  I even tried to install Microsoft Access Database Engine for 2010 http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=13255 which I think you need if you don't have office installed.



I have co-workers in another location that have upgraded to 2010, but do not have the same issues.



Where does the DDT.ExcelDriver look for the driver?  I'm not sure if it is still looking for the 2007 ACE driver or if when Office 2010 was installed it was put in a different location then it is expected.



I have tried to uninstalled TestComplete, rebooted, and then reinstalled TestComplete but no good.

9 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    strFile, according to your watch list, is an object, not a string.  Are you passing in the string path to the Excel sheet or something else?  It just seems like there's a problem in what you're passing in there and that may be what's causing your problem.
  • mmaniscalco's avatar
    mmaniscalco
    Occasional Contributor
    strFile is an object of type String.



    ClrClassName String

    ClrFullClassName System.String

    Length 72

    OleValue C:\automation\blah\blah\file.xlsx



    I have another machine next to me and rant the same code and it works on it and has the same locals.  This other machine is running 2007.
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    The reason I ask is that strSheet is resolving in your watch list as the actual string value while strFile is not.



    While it seems the primary difference is between the office versions, I'd take a look at how the filename/path is being passed in and see if there is something you can do to get it to resolve in the same way that strSheet does.  Try wrapping it in an aqConvert.VarToStr() call and see if that fixes it...



    Just stretching here, mind you, as far as I know there shouldn't be any problem between Excel 2010 and Excel 2007... I have a user here in my office that is using DDT.ExcelDriver with Excel2010 and is not experiencing these problems.
  • mmaniscalco's avatar
    mmaniscalco
    Occasional Contributor
    I'll try anything at this point including voodoo magic.



    Same result after I forced it to a primitive string.
  • mmaniscalco's avatar
    mmaniscalco
    Occasional Contributor
    No luck with the ACE 2007 drivers.  It must be some kind of conflict or incorrectly configured setting, but I have no idea what ExcelDriver is looking for.
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Another quick "Just in case I did something stupid" style of check (I do those ALL the time since the chances of me doing something stupid increases exponentially as the amount of caffeine in my blood stream drops). 



    Can you open the Excel file manually on your box?  If so, what happens?  Are there any particular prompts for conversion or other such things that might mess up a data access driver?



    Also, what's the data in the file?  Is it coming through correctly with proper data types etc?



    One final check:



    Make sure there's not a copy of Excel sitting memory resident in the background that MIGHT have hooks into your excel file.



    I'm scraping the bottom of the barrel here but with a message like "unknown error from external driver" to help us, I'm kinda at a loss.
  • mmaniscalco's avatar
    mmaniscalco
    Occasional Contributor
    Got it working.



    I uninstalled and then reinstalled Office.  It must have been something wrong with the automated upgrade that caused the issue.



    Thanks for all the help.
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Reboot/Reinstall/Reformat



    At least we didn't get to the third one of those. :-)  Glad to hear it's working now.