Solved

Programmatically Set the MultiLine Property of Activex Textbox

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

830 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