cancel
Showing results for 
Search instead for 
Did you mean: 

Excel file causes serious error when opened during TestComplete runs

SOLVED
subbu_valliappa
Contributor

Excel file causes serious error when opened during TestComplete runs

In our TestComplete scripts that we run overnight, a particular script is setup to open Excel spreadsheet and copy its data. It has been running alright until lately when we have noticed an unexpected message when the Excel file is opened. It reads "The document caused a serious error the last time it was opened. Would you like to continue opening it?"



This only happens when TestComplete scripts are run, and so far can't be reproduced by opening the file manually. Is there something that I can do in the scripts to debug the file properties whenever it is opened? I would like to understand what is happening to the file when the scripts are run, and it has been tricky so far.



Any help would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
murugans1011
Regular Contributor

RE: Excel file causes serious error when opened during TestComplete runs

The issue occurs when the excel workbook is not closed property by terminating the excel application and opening the same file again and  the issue is related to excel application. may be try the following solution



View solution in original post

5 REPLIES 5
tristaanogre
Community Hero

RE: Excel file causes serious error when opened during TestComplete runs

Is it possible that you are opening the file during your scripts but then failing to close it properly?  It may be that the "error" being reported is some sort of improper exit or closure of the Excel process in windows.  Double check to make sure that, once your script is finished with the Excel spreadsheet, it is closing it properly.

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
subbu_valliappa
Contributor

RE: Excel file causes serious error when opened during TestComplete runs

Checked my script and it is closing the Excel file properly indeed.



Can I insert some sort of debug messages or anything similar when the file is opened?
murugans1011
Regular Contributor

RE: Excel file causes serious error when opened during TestComplete runs

The issue occurs when the excel workbook is not closed property by terminating the excel application and opening the same file again and  the issue is related to excel application. may be try the following solution



View solution in original post

tristaanogre
Community Hero

RE: Excel file causes serious error when opened during TestComplete runs

Murugan is basically backing up what I said... your script may be closing Excel... but some thing in the way you are closing it is doing it improperly.  Follow that MSN article and see if that helps.

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
subbu_valliappa
Contributor

RE: Excel file causes serious error when opened during TestComplete runs

Probably that is right. I'll look into the script further and see if there is anything odd there while closing the Excel file.



In the meantime, the solution on the MSN website seems to work.



Thanks for your help.
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors