Print Page | Close Window

Text Object

Printed From: TMS Software
Category: .NET Components
Forum Name: .NET Flexcel
Forum Discription:
Printed Date: 30 May 2020 at 4:38pm

Topic: Text Object
Posted By: Brindley David
Subject: Text Object
Date Posted: 16 Nov 2012 at 7:19am
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
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.

Posted By: Adrian Gallero
Date Posted: 16 Nov 2012 at 7:47am
You were almost there :)

Just replace "????????" by:
xls.SetObjectText(intLoop, """Hello")
And it should work. 

Posted By: Brindley David
Date Posted: 16 Nov 2012 at 8:14am
Thanks Adrian,
Works a treat.

Print Page | Close Window