Solved

Programmatically Set the MultiLine Property of Activex Textbox

Posted on 2010-09-21
3
591 Views
Last Modified: 2012-05-10
I can't for the life of me figure out how to programmatically set the multiline property of a text box.

Here's what I have.....Multiline isn't working, although in the textbox properties it is a valid property

Any ides?


Sub Insert_txt()

Dim txt As OLEObject



Set txt = Me.OLEObjects.Add(ClassType:="Forms.TextBox.1")

        With txt

            .Left = activecell.Offset(0, 1).Left

            .Height = activecell.RowHeight * 5

            .Name = activecell.Address

            '.MultiLine = True

        End With

End Sub

Open in new window

0
Comment
Question by:MWGainesJR
  • 2
3 Comments
 
LVL 24

Accepted Solution

by:
StephenJR earned 500 total points
ID: 33728222
This worked for me. Btw Excel didn't like Me.
Sub Insert_txt()
Dim txt As OLEObject

Set txt = ActiveSheet.OLEObjects.Add(ClassType:="Forms.TextBox.1")
        With txt
            .Left = ActiveCell.Offset(0, 1).Left
            .Height = ActiveCell.RowHeight * 5
            .Name = ActiveCell.Address
            .Object.MultiLine = True
        End With
End Sub

Open in new window

0
 
LVL 13

Author Comment

by:MWGainesJR
ID: 33728268
Yeah I forgot to change the Me.  I pulled that peice of code from a Worksheet_change event.
But anyway,  That was it!....Thanks....never thought of trying that one.
0
 
LVL 13

Author Closing Comment

by:MWGainesJR
ID: 33728272
Thanks
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now