![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Selecting a Sheet in Excel Using Automation Topic Summary: Created On: 11-May-2005 14:05 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: This is a piece of code I use to get a sheet called "NCMS Export" from an Excel file: // select front sheet OleAutoObj objSheets = null checkRes(oleGet(objExcel, "Sheets", objSheets)) int numSheets = 0 checkRes(oleGet(objSheets, "Count", numSheets)) int s for s in 1:numSheets do { OleAutoObj objThisSheet = null clear(args) put(args, s) checkRes(oleGet(objSheets, "Item", args, objThisSheet)) string thisSheetName = "" checkRes(oleGet(objThisSheet, "Name", thisSheetName)) if ( thisSheetName == "NCMS Export" ) { objSheet = objThisSheet break } } | |
![]() |
|
Hi,
I am struggling to select a sheet in a workbook which I am opening from within DOORS. I can open Excel, then the workbook but I cannot get a handle on a specified sheet. Any ideas? Edited: 11-May-2005 at 14:06 by Ken Mcguffie |
|
![]() |
|
![]() |
|
This is a piece of code I use to get a sheet called "NCMS Export" from an Excel file:
// select front sheet OleAutoObj objSheets = null checkRes(oleGet(objExcel, "Sheets", objSheets)) int numSheets = 0 checkRes(oleGet(objSheets, "Count", numSheets)) int s for s in 1:numSheets do { OleAutoObj objThisSheet = null clear(args) put(args, s) checkRes(oleGet(objSheets, "Item", args, objThisSheet)) string thisSheetName = "" checkRes(oleGet(objThisSheet, "Name", thisSheetName)) if ( thisSheetName == "NCMS Export" ) { objSheet = objThisSheet break } } ------------------------- Karen Hidalgo<BR>Northrop Grumman - TASC<BR>karen.hidalgo@ngc.com Edited: 11-May-2005 at 15:25 by Karen Hidalgo |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Selecting a Sheet in Excel Using Automation
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.