Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bill, thank you for posting this problem. I had just
encountered bizarre behavior in a textbox, similarly populated from VBA. I was displaying data validation messages. It worked fine for all but one column of cells. I could see that the lenght of the title was being used, the code stepped through correctly, but the validation message of the previously-entered cell was being displayed instead!! You have solved my problem, and a LOT of potential tears that were just getting ready to flow!! Kate Bill Dilworth wrote: Here is some basic vba code for automating an Excel sheet from a PPT app. I want to add a rectangle with some text to sheet 1. I know (because I control the file creation) that this will be the 6th shape on sheet 1. So I used this code: oExcel.Sheets(1).Shapes _ .AddShape(1, y + 10, (2 * x) + 20, y, x) _ .TextFrame.Characters.Text = _ strText Works great, up to a point. If strText gets to about 200-250 characters, it blanks out the text display in the box, nada, nothing, gone, pfft. I tried changing the shape to a textbox (AddTextBox), with no change in behavior. Since I know the text will be between 10 and 400 characters, depending on the circumstances, I am forced to run with something like this: oExcel.Sheets(1).Shapes _ .AddShape(1, y + 10, (2 * x) + 20, y, x) _ .TextFrame.Characters.Text = _ Left(strText, 200) If Len(strText) 200 Then _ oExcel.Sheets(1).Shapes(6) _ .TextFrame.Characters(200) _ .Insert Right(strText, _ Len(strText) - 200) I just wondering if I am missing something silly, or is this a standard Excel design "feature"? Perhaps this is a cross app VBA inconvenience, but it kept me up half the night, banging my head against the monitor, trying to figure out where strText went half the time. The code now works, so this isn't a crisis anymore, but I would love to find out why it does this. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cutting and Pasting Cells into a shape or textbox | Excel Discussion (Misc queries) | |||
Interesting problem! | Excel Programming | |||
Editting textbox value that is grouped with a shape | Excel Programming | |||
Hyperlink within the TextFrame of Shape Object..? | Excel Programming |