![]() |
| The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum. |
|
Post Reply
|
| Author | |
warossi
Newbie
Joined: February 11 2008 Location: United States Status: Offline Points: 9 |
Post Options
Thanks(0)
Quote Reply
Topic: ObjectBridgePosted: September 29 2011 at 1:25am |
|
I am trying to get data from an excel spreadsheet using objectbridge. I took the example and modified the
CALL ATGETPROPERTY(Worksheet, Z1, Z2, ERRMSG, OPTS) to CALL ATSETPROPERTY(Worksheet, Z1, Z2, ERRMSG, OPTS) assuming that Z2 would contain the values of the cells specified in Z1. This is not the case. it is coming back with something but not the data in the cell. I am using this to find a specific value to use as a starting point for other modifications. Thanks |
|
|
Bill Rossi
warossi@direct-path.net |
|
![]() |
|
PSchellenbach
Admin Group
Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
Quote Reply
Posted: September 29 2011 at 4:31am |
|
Hi Bill -
If you examine the sample UPDATE.EXCEL.SPREADSHEET program, you see that Z1 and Z2 are dynamic arrays passed to ATSETPROPERTY. Z1 is a list of property names and Z2 is a corresponding list of values to assign to those properties. The property name in Z1 can be appended with index values if the property acts like an array. In the example, the property name is 'Cells', which in Excel, works like an array, so the row and columns are appended using SVM as a separator. In the case of ATGETPROPERTY, Z1 is exactly the same as ATSETPROPERTY, and Z2 should return the cell values. Thanks, Pete |
|
![]() |
|
warossi
Newbie
Joined: February 11 2008 Location: United States Status: Offline Points: 9 |
Post Options
Thanks(0)
Quote Reply
Posted: September 29 2011 at 11:42pm |
|
Pete,
That's what I thought but the results don't agree. I added this code to the UPDATE.SXCEL.SPREADSHEET program CALL ATSETPROPERTY(Worksheet, Z1, Z2, ERRMSG, OPTS) IF ERRMSG NE '' THEN PRINT ERRMSG; CALL ATRESETOBJMGR; STOP Z3='' CALL ATGETPROPERTY(Worksheet, Z1, Z3, ERRMSG, OPTS) IF ERRMSG NE '' THEN PRINT ERRMSG; CALL ATRESETOBJMGR; STOP CRT Z3 and the output of Z3 looks line this 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 Seperated by @AM when I expected to get the data I passed. Thanks |
|
|
Bill Rossi
warossi@direct-path.net |
|
![]() |
|
PSchellenbach
Admin Group
Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
Quote Reply
Posted: September 30 2011 at 11:14am |
|
Hi Bill -
It looks like the Cell(x,y) property returned by Excel is not a string, but a Range object. ObjectBridge represents objects using consecutive integers, which explains what you are seeing. You need to then use each of the values returned in Z3 as objects and call ATGETPROPERTY for each of these, retrieving the 'Value' property of each:
Sorry about the misinformation. Excel's object model is quite complex, and ObjectBridge sometimes is too simplistic to cope adequately. The reason it worked to set the property is that Excel probably uses the Value as the default property for the Range object, so it was not necessary to explicitly set it. 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 |