Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Text Object

 Post Reply Post Reply
Author
Brindley David View Drop Down
New Member
New Member
Avatar

Joined: 15 Nov 2012
Posts: 2
Post Options Post Options   Quote Brindley David Quote  Post ReplyReply Direct Link To This Post Topic: Text Object
    Posted: 16 Nov 2012 at 7:19am
Hi,
 
I'm new to Flexcel and so far everything has been straightforward.

However, I have a legacy Excel 2003 spreadsheet (supplied by a third party) which my software needs to export data into.
 
This spreadsheet has some textbox objects on and I need to set the text within this object to some data from my database. This particular textbox object has a name Text 627
 
I've done the following to find the object which it does but I'm getting stuck on the line to actually set the text of the object.
 
Dim intLoop As Integer
For intLoop = 1 To xls.ObjectCount
Dim ShapeProps As TShapeProperties = xls.GetObjectProperties(intLoop, True)
Dim ShapeOption As TShapeOption
If ShapeProps.ShapeName IsNot Nothing Then
If ShapeProps.ShapeName = "Text 627" Then
???????????
End If
End If
Next
 
I've tried using SetObjectProperty but I can't seem to get the syntax right. I'm sure I'm just being a bit thick but any help or advise would be gratefully recieved.
 
 
 
Back to Top
Adrian Gallero View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 1233
Post Options Post Options   Quote Adrian Gallero Quote  Post ReplyReply Direct Link To This Post Posted: 16 Nov 2012 at 7:47am
Hi,
You were almost there :)

Just replace "????????" by:
xls.SetObjectText(intLoop, """Hello")
And it should work. 
Regards,
  Adrian
Back to Top
Brindley David View Drop Down
New Member
New Member
Avatar

Joined: 15 Nov 2012
Posts: 2
Post Options Post Options   Quote Brindley David Quote  Post ReplyReply Direct Link To This Post Posted: 16 Nov 2012 at 8:14am
Thanks Adrian,
 
Works a treat.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down