Solved

Programmatically Set the MultiLine Property of Activex Textbox

Posted on 2010-09-21
3
667 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

628 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