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: Import from Excel
Topic Summary: Enjoy :)
Created On: 28-Jul-2008 21:08
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.
 28-Jul-2008 21:08
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

Import from Excel

Wrote this about a year ago.

It's not 100% perfect due to limitations with working with Excel. But we've used it pretty reliably here. Biggest thing to worry about is truncations from getting the cell text (I tried using value instead but had problems). It does do some checking for truncations on its own.

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


Martin Hunter

Posts: 7
Joined: 24-Jul-2008

I have used Michael Sutherland's Enhanced Export to Excel tool. Some of the columns in my DOORS module have OLE objects as icons and these all get exported. When I use the Import from Excel tool, the OLE objects are not imported.

Am I doing something wrong, is this not possible with this tool and if so has anyone updated the tool to handle OLE imports?

-------------------------
Martin
Report this to a Moderator Report this to a Moderator
 18-Sep-2008 13:15
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

Sorry I did not write it to handle OLE. Did you try importing with rich text? That basically does a copy-paste of the Excel cell into DOORs. So it might work.

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


Martin Hunter

Posts: 7
Joined: 24-Jul-2008

David,

I tried the rich text import but that didn't work.

On investigation the OLE does not appear to be assigned to a specific cell and can be moved around on the spreadsheet so maybe this is why it isn't imported.

I'll update this post when I get more information.

As an aside I have just finished updating Michael Sutherland's Export tool to incorporate running an excel macro at the end of the export.

Cheers,

Martin

-------------------------
Martin
Report this to a Moderator Report this to a Moderator
 30-Oct-2008 11:39
User is offline View Users Profile Print this message


Chris Collingwood Hancock

Posts: 4
Joined: 2-Jan-2008

Hi David,

With reference to the 'GetCellText' function, which obtains the 'Text' property of the cell, how would I obtain the 'Comment' property of a cell? I tried the simple step of renaming the 'GetCellText' funtion to 'GetCellComment' and changing the line reading:
- if(!checkResult(oleGet(ExcelCell, "Text", s))) to
- if(!checkResult(oleGet(ExcelCell, "Comment", s)))

...but to no avail.

Any ideas, its probably a breeze but it's nearly Friday and perhaps I'm just due a holiday!!

All the very best to you and the rest of the DXL community,

Chris.
Report this to a Moderator Report this to a Moderator
 30-Oct-2008 11:45
User is offline View Users Profile Print this message


Chris Collingwood Hancock

Posts: 4
Joined: 2-Jan-2008

See attached, just to clarify the 'comment' property I'm referring to...

Many thanks,

Chris

CellComment.bmp
CellComment.bmp  (447 KB)

Report this to a Moderator Report this to a Moderator
 30-Oct-2008 17:31
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

Sorry Chris I'm at a loss here right now as well. I tried using a range since that's what Excel seems to do in VBA. Then I thought maybe the Comment was an object of a range as well. It doesn't seem to throw an error when trying to get a handle to a Comment object of a Range but then if I try to get the text of the comment object, it says it isn't a valid member. I'll keep working at it later. Was just trying to see if I could give you a quick solution.

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


ron lewis

Posts: 650
Joined: 20-Sep-2004

To get a comment from Cell A1 the syntax is:
s = Range("A1").Comment.Text

Of course you have to translate the syntax to dxl.
Report this to a Moderator Report this to a Moderator
 30-Oct-2008 18:09
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

Yeah that's what I did. But it I got an error when trying to get the Text from the Comment. As I said I'll take a look at it more on Monday if no one's figured it out by then.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 31-Oct-2008 13:16
User is offline View Users Profile Print this message


Dennis Lockshine

Posts: 113
Joined: 7-Apr-2003

In this case, "Text" is a method associated with the Comment object. You must use the DXL command oleMethod to get the value of the comment text.

Here is a short piece of code that illustrates this use. Assume that you already have the ExcelCell object assigned:
Report this to a Moderator Report this to a Moderator
 31-Oct-2008 13:57
User is offline View Users Profile Print this message


Chris Collingwood Hancock

Posts: 4
Joined: 2-Jan-2008

Hi David, Ron and Dennis

You guys are 'da men'!!!
Respect to you and the rest of the DXL community.
I can now relax, go home and start my weekend early thank to you guys!!

All the best and enjoy the weekend

Chris
Report this to a Moderator Report this to a Moderator
 3-Nov-2008 14:05
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

Thanks Denis. I hadn't tried to get the Comments of a cell before.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 5-Dec-2008 15:28
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

I updated the script to fix a bug. If you use it I suggest you go redownload it.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 9-Dec-2008 11:00
User is offline View Users Profile Print this message


Karl Breuer

Posts: 66
Joined: 11-Jul-2005

David,

I did as you suggested, but now the script complains about undeclared variables
- openLogFile
- closeLogFile
- getCellNumberFormat

it seems that at least the logFile functions have disappeared from your script.
Did you update your ExcelFunctions.inc as well?

greets
Karl
Report this to a Moderator Report this to a Moderator
 9-Dec-2008 13:53
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

Thank you Karl. Sometimes it's hard to remember what all was changed. Redownload the excel functions to fix this.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com

Edited: 9-Dec-2008 at 13:54 by David Pechacek
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 0 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 0 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.