#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 47
Default 2003 vba in 2007

I am using the following code in excel 2003. It works fine. When I try to use
the file in 2007 I get this error:
Run-time error '1004':
"Unable to get the Characters property of the TextBox class"

This code is highlighted in yellow:

txtBox1.Characters(Start:=startPos, _
Length:=Len(cell.Value)).Text = cell.Value & Chr(10)

Why does it work in 03 but not 07?

Here is more of the code:
I am using it to fill a textbox with data validation/help info

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$12" Then
txtBox1.Text = " "
Set theRange = Worksheets("Help").Range("B37:B41")
txtBox1.Visible = msoTrue
startPos = 1
For Each cell In theRange
txtBox1.Characters(Start:=startPos, _
Length:=Len(cell.Value)).Text = cell.Value & Chr(10)
startPos = startPos + Len(cell.Value) + 1
Next cell
Else
End If
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
2007 & 2003 - Default open with 2003 JudithJubilee Excel Discussion (Misc queries) 4 June 6th 08 04:18 PM
Excel 2007 Macro Help (Excel 2003 not working in 2007) Pman Excel Discussion (Misc queries) 4 May 29th 08 06:29 PM
Different in 2007 vs 2003 Donna Charts and Charting in Excel 2 March 26th 08 05:07 PM
when 2007 is installed side-by-side with 2003, open xls with 2003 rbyteme Setting up and Configuration of Excel 2 August 4th 07 01:44 AM
2003 and 2007 steve55 Excel Discussion (Misc queries) 1 August 3rd 07 11:11 AM


All times are GMT +1. The time now is 05:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"