![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Import from Excel Topic Summary: Enjoy :) Created On: 28-Jul-2008 21:08 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|||
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 |
|||
![]() |
|||
![]() |
|||
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 |
|||
![]() |
|||
![]() |
|||
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 |
|||
![]() |
|||
![]() |
|||
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 |
|||
![]() |
|||
![]() |
|||
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. |
|||
![]() |
|||
![]() |
|||
See attached, just to clarify the 'comment' property I'm referring to...
Many thanks, Chris
|
|||
![]() |
|||
![]() |
|||
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 |
|||
![]() |
|||
![]() |
|||
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. |
|||
![]() |
|||
![]() |
|||
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 |
|||
![]() |
|||
![]() |
|||
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: |
|||
![]() |
|||
![]() |
|||
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 |
|||
![]() |
|||
![]() |
|||
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 |
|||
![]() |
|||
![]() |
|||
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 |
|||
![]() |
|||
![]() |
|||
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 |
|||
![]() |
|||
![]() |
|||
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 |
|||
![]() |
Telelogic DOORS
» DXL Exchange
»
Import from Excel
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.