Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Selecting the same sheet in excel several times
Topic Summary: Excel error generated while closing the application
Created On: 30-Jul-2008 14:52
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 30-Jul-2008 14:52
User is offline View Users Profile Print this message


Antoine Caille

Posts: 3
Joined: 26-Aug-2003

Hello all,

I try to understand with I have a Excel error message when I close the excel document:
EXCEL a généré des erreus et sera fermé par Windows. Vous devez redémarrer le programme. Un journal des erreurs est en cours de rédaction.
In english something like:
Excel has generated a error and will be closed by Windows. You must restart the application. An error log is being written.

I've well located the origin of the problem.
I use a function to select a specific sheet in excel:
OleAutoObj XLSgetSheet(OleAutoObj pWorkbook, string pName) {
OleAutoObj mSheet = null
OleAutoArgs mArg = create

clear(mArg)
if (!null pWorkbook) {
put(mArg, pName)
oleGet(pWorkbook, "Worksheets", mArg, mSheet)
if (null mSheet) {
errorBox ("Unable to activate sheet " pName " for Excel application.")
}
} else {
errorBox ("Null Workbook handle.")
}

delete mArg
return mSheet
}


If I call sheet 1, then 2, then 3 (with their name): no problem (handels are good).
But If I call sheet 1, then 2, then an other time 1: the message appears when I close Excel (even I save the document or not) AND handels are good !!

I've created the same function to call a sheet with its number, and the result is the same.

I found this way to code this or with "Sheet" instead of "Worksheets" but the problem is the same.


Do you know how to eliminate the problem ? do you know where to find this log ?

Thanks in advance

PS I use DOORS 8.2 and Excel 2000

Edited: 30-Jul-2008 at 14:53 by Antoine Caille
Report this to a Moderator Report this to a Moderator
 30-Jul-2008 18:59
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

Here is my function to get a sheet by its number. One thing is that you have to be careful. Sometimes there are things in a workbook that return as a sheet, but are not.

cPropertySheets = "Sheets"
cMethodActivate = "Activate"

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 30-Jul-2008 19:59
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

A version that doesn't use global variables

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 18-Aug-2008 09:22
User is offline View Users Profile Print this message


Antoine Caille

Posts: 3
Joined: 26-Aug-2003

Hello

I have finally a little bit time to test your function.
I found on the net that your function is :
bool checkResult(string res) {
if(res != "") {
if(confirm("OLE method failed: \n" res "\n\n Do you wish to continue?", msgError)) {
return false
}
else {
progressStop()
halt
}
}
return true
}


But your version of the getSheet doesn't avoid windows error message.
Report this to a Moderator Report this to a Moderator
 18-Aug-2008 13:43
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

What error are you getting?

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 29-Aug-2008 10:55
User is offline View Users Profile Print this message


Antoine Caille

Posts: 3
Joined: 26-Aug-2003

EXCEL a généré des erreus et sera fermé par Windows. Vous devez redémarrer le programme. Un journal des erreurs est en cours de rédaction.
In english something like:
Excel has generated a error and will be closed by Windows. You must restart the application. An error log is being written.
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.