Wrap text in spreadsheet activex

inbal

Registered User.
Local time
Today, 05:37
Joined
Feb 8, 2009
Messages
48
Hi all,

I have added a spreadsheet to my application, but sime times the text is too big, so I tried to put the attribute wraptext=true, but I couldn't found t.

Can you please help me.

my code is:

Dim dbVideoCollection As DAO.Database
Dim rstVideos As DAO.Recordset
Dim dbVideoCollection1 As DAO.Database
Dim rstVideos1 As DAO.Recordset
Set dbVideoCollection = CurrentDb
Set dbVideoCollection1 = CurrentDb
Dim r, j As Integer
Dim myitem1 As Integer
Dim myitem2 As String
Dim myitem3 As String

Set rstVideos = dbVideoCollection.OpenRecordset("rooms")
rstVideos.MoveFirst
Dim rooms(11) As String
r = 2
Do Until rstVideos.EOF
myitem1 = rstVideos.Fields.Item("roomnumber")
Spreadsheet0.ActiveSheet.Cells(999, r).Value = myitem1
myitem2 = rstVideos.Fields.Item("name")

rooms(r) = myitem2
Spreadsheet0.ActiveSheet.Cells(1, r).Value = myitem2
rstVideos.MoveNext
r = r + 1
Loop
 
I am not an Excel wizzkid so what i do is start the Excel Macro recorder do what needs to be done, stop the recorder and look at the code.

This is what i found:
Code:
Selection.WrapText = True
Selection is a property of the Excel Application so in your case
Code:
Spreadsheet0.Selection.WrapText = True
should work.

HTH:D
 
Thank HTH,

I added the code and it wrote me:
Run time error 438
Object doesn't support this property or method

So, if you know other ways...

Thanks
 

Users who are viewing this thread

Back
Top Bottom