Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Programmatically Set the MultiLine Property of Activex Textbox

Posted on 2010-09-21
3
Medium Priority
?
701 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 2000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

885 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