Forum Discussion

rw's avatar
rw
Occasional Contributor
13 years ago

"The Interface is Unknown" issue reading Excel files

Hi guys.



I am really stumped on this one. With this issue, it's breaking my automation. Basically, when I read in Excel files for testing, quite often TestComplete stops outright with an error saying "The interface is unknown". 




  Set ExcelCore = Sys.OleObject("Excel.Application") 

  Set ExcelFile = ExcelCore.Workbooks.Open(tempfile)    < - Right here is where it breaks.



I'm on TC 7.52, and upgraded from Office 07 to 10. Sadly, the 10 upgrade didn't help. Any way around this? It's breaking my automation. 

3 Replies

  • AlexeyK's avatar
    AlexeyK
    SmartBear Alumni (Retired)

    Hi,


    It seems that something is wrong with Microsoft Excel automation. This problem is similar to the Excel automation issue discussed here:


    http://www.sqaforums.com/showflat.php?Number=697954


    So, try any of the following:


    * Open Task Manager and terminate all the Excel processes. Check whether your script code runs successfully.


    * Run TestComplete with administrator privileges. To do this, right-click the TestComplete shortcut and choose "Run as Administrator" from the context menu.

  • rw's avatar
    rw
    Occasional Contributor
    That was me also. Heh. So, the key between excel calls is to completely destroy the excel.exe process? I have made sure I haven't doubled up calling new excel objects(ie nested functions).
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Well, you can create a "global" excel object that you can use all over the place.  That way you won't be creating multiple instances, just the one instance.