![]() |
| The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum. |
|
Post Reply
|
| Author | |
Gauthier
Newbie
Joined: March 02 2004 Location: United States Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Topic: ObjectBridge and Excel questionPosted: March 02 2004 at 6:54am |
|
Using the sample code, every time I use an Excel session it opens a new sessions even if Excel is open. Is there a way to 'connect' to the current open Excel session and avoid multiple Excel sessions?
|
|
![]() |
|
PSchellenbach
Admin Group
Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
Quote Reply
Posted: March 04 2004 at 10:54am |
|
You can get a reference to a running instance of Excel. Here is some sample code:
CALL ATINITOBJMGR(ERRS,OPTS) IF ERRS <> '' THEN CALL ATRESETOBJMGR; PRINT ERRS; STOP * CALL ATGETOBJECT('','EXCEL.APPLICATION',OBJID,ERRS,OPTS) IF ERRS <> '' THEN CALL ATRESETOBJMGR; PRINT ERRS; STOP * CALL ATGETPROPERTY(OBJID,'WORKSHEETS',SHEETS,ERRS,OPTS) IF ERRS <> '' THEN CALL ATRESETOBJMGR; PRINT ERRS; STOP * CALL ATGETPROPERTY(SHEETS,'COUNT',CNT,ERRS,OPTS) IF ERRS <> '' THEN CALL ATRESETOBJMGR; PRINT ERRS; STOP PRINT 'COUNT=':CNT * CALL ATRELEASEOBJECT(SHEETS,ERRS,OPTS) CALL ATRELEASEOBJECT(OBJID,ERRS,OPTS) * CALL ATRESETOBJMGR * STOP Thanks, Pete |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |