Rocket Software Homepage
Forum Home Forum Home > AccuTerm Knowledge Base (read only) > Advanced Features
  New Posts New Posts RSS Feed - ObjectBridge and Excel question
  FAQ FAQ  Forum Search   Register Register  Login Login

The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum.

Forum LockedObjectBridge and Excel question

 Post Reply Post Reply
Author
Message
Gauthier View Drop Down
Newbie
Newbie


Joined: March 02 2004
Location: United States
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gauthier Quote  Post ReplyReply Direct Link To This Post Topic: ObjectBridge and Excel question
    Posted: 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?
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.