Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

curline problem migrating from excel 2002 to 2007

Status
Not open for further replies.

automaker

Technical User
Aug 21, 2007
64
US
I am running XP pro 2002 sp2. I created an Excel VBA program that had a form with a textbox. The text in the textbox required a vertical scrollbar. To make sure the user saw the text from the beginning, I had a statement like

userform.textbox.curline=0

This worked fine until the "upgrade" to Office 2007. Now the application crashes on the above statement. It works fine if I change the zero to a one but then the user has to click the "up" arrow of the scroll bar to see the first line of text.

Microsoft help still claims that the first line of text has curline=0.

Any thoughts?

By the way, when it crashes I get a run-time error
-2147418113 (8000ffff)

Thanks for any insights.
 
Is there a .visible property for the object in question? If so, then you can set .visible to false, and problem should be solved. I say if, b/c I've not tried it, just thinking of what I use with other objects.
 
KJV1611,
I think I have not explained the problem clearly.
If I set curline=1 then the top line in the textbox is the second line of text. To see the first line, the user must click on the up arrow of the vertical scrollbar.

Originally, I had curline=0 which showed the first line of text at the top of the textbox. Curline=0 now causes the runtime error I mentioned above.

I would like the textbox to display the text starting with the first line of text.

If this doesn't help clear things up, let me know and I will provide some code that demonstrates the problem.

Thanks
 
Anybody have any suggestions? Is this an Excel 2007 VBA code thing? What about some type of cursor up command?

Thanks,
 
No crash, but error is reported in 2003. You can try instead (works for me in 2003):

Me.TextBox1.SelStart = 0

combo
 
combo,
Thank you. That did the trick. I was really struggling with finding a property that I could set or a method that would move the cursor up a line. I don't understand why curline=0 stopped working. But then I can't understand why filesearch was taken out.

Thanks again.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top