Pinned topic Opening a Excel Spreadsheet and accessing a CELL in DXL
I want to in DXL:
1. Open an Excel spreadsheet.
2. Access a particular cell within the spreadsheet.
3. Assign the value of the cell to a DOORS attribute.
Any help would be much appreciated.
Mathias Mamsch 2700025PVX1953 PostsACCEPTED ANSWER
Re: Opening a Excel Spreadsheet and accessing a CELL in DXL2010-11-14T19:01:03Z in response to MichaelNugentThere is an example in the DOORS DXL help ("Automation client support") which will do the opposite, i.e. write a value to an excel sheet, but that is pretty much the same. Any luck trying the example?
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Avinash Singh 270006NJ0U1 PostACCEPTED ANSWER
Re: Opening a Excel Spreadsheet and accessing a CELL in DXL2013-10-24T06:56:43Z in response to Mathias Mamsch
hi Mathias Mamsch 2700025PVX,
new to this forum i need to import values from excel to doors attributes. I can get value from single cell to attribute in doors but problem i am facing is when the cells are MERGED in excel my script stops. if u have any idea on this please let me know. below is where i am getting the cell value from excel code section
string getCellValue(OleAutoObj objExcelSheet, int row, int col)
string sValue = null
OleAutoObj objCell = null
OleAutoArgs autoArgs = create
put(autoArgs,row) // put the row number of excel sheet to args
put(autoArgs,col) // put the col number of excel sheet to args
if(objExcelSheet == null) // check for excel sheet is null " no contents in the sheet "
warningBox("Excel sheet not contains any data it is blank ")
oleGet(objExcelSheet,"Cells",autoArgs,objCell) // if data is present then
if (!null objCell)
// Get the value
oleGet(objCell,"Value",sValue) // fetch the data from cell
return sValue // return the fetched data of the cell with specific row and column
Thanks in advance
This reply was deleted by llandale 270001QM9N 2013-10-24T14:49:03Z. Reason for deletion: Will Post Update
llandale 270001QM9N2943 PostsACCEPTED ANSWER
Re: Opening a Excel Spreadsheet and accessing a CELL in DXL2013-10-24T15:04:21Z in response to Avinash Singh
Did some investigating. Open this file for an example (or whereever it is on your computer)
- c:\Program files\IBM\Rational\DOORS\9.3\lib\dxl\standard\export\office\excel.dxl
Function "setCell()" line #172 suggests if you convert cell "2,4" to "B4" you can use the "Range" property to get your "Cells" range. It uses function "intToCol()" starting line #140 to convert "2" to "B".
In any event, if you have to arguments to a property (such as "Cells") you need to give them names. I could not find the names, but perhaps they are "rowNumber" and "colNumber".
- put(autoArgs, "rowNumber", row)
- put(autoArgs, "calNumber", col)
SpaceApe 27000240VH11 PostsACCEPTED ANSWER
Re: Opening a Excel Spreadsheet and accessing a CELL in DXL2011-12-18T15:42:56Z in response to SystemAdminWith following configuration, integer in excel cell is returned as null by the DXL script provided by NilsPalsson about an year back (in 2010).
1) Office 10
2) DOORS 9.3
Any idea what might be the cause? and work-around it?
Re: Opening a Excel Spreadsheet and accessing a CELL in DXL2011-12-19T09:00:24Z in response to SpaceApe
Tried the DXL script with Excel 2010. It did work in the situation you described when I used
int iValue = 0
in getCellValue instead of the original string variable.
- Pekka Mäkinen - http://www.softqa.eu/
Updated on 2013-12-19T20:54:06Z at 2013-12-19T20:54:06Z by JAntley
- Pekka Mäkinen - http://www.softqa.eu/
pommCannelle 270006200841 PostsACCEPTED ANSWER
Re: Opening a Excel Spreadsheet and accessing a CELL in DXL2013-10-25T12:36:24Z in response to MichaelNugent
( Hi !
For your next try ... There is a very complete example to deal with the excel automation here : http://www.galactic-solutions.com/downloadsv/GalacticDownloadExcel.htm
... I hope there is no offense to provide an external link ! )