Solved

Programmatically Set the MultiLine Property of Activex Textbox

Posted on 2010-09-21
3
643 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
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…

752 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