Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default OLE Object -TexBox Properties

Hello ,

I have a Worksheet in which I'm Adding Text Box from the Control Toolbox via
VB Code. What I'm not able to do is to set the Properties of the Textbox in
the code.
I'm able to change the name as below
Set TextBoxCreated =
ActiveSheet.OLEObjects.Add(ClassType:="Forms.TextB ox.1", Link:=False,
DisplayAsIcon:=False, _
Left:=ActiveCell.Left, _
Top:=ActiveCell.Top, _
Width:=ActiveCell.Width, _
Height:=ActiveCell.Height)

TextBoxCreated.Name = ActiveCell.Address


But What I want to do is to change some more properties like
EnterKeybehavior and MultiLine which I'm unable to do. Can this be acheived
?
OR Can I Add the TextBox with the EnterkeyBehaviour and Multiline having
values as TRUE insted of the Default FALSE?

Thanks,
SSR


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default OLE Object -TexBox Properties

TestboxCreated is an OleObject. If you want to get to the textbox itself.
This code works for example:

Sub Tester1()
Dim TextBoxCreate As OLEObject
Dim tBox As MSForms.TextBox
Set textboxcreated = _
ActiveSheet.OLEObjects.Add(ClassType:="Forms.TextB ox.1", _
Link:=False, DisplayAsIcon:=False, _
Left:=ActiveCell.Left, _
Top:=ActiveCell.Top, _
Width:=ActiveCell.Width, _
Height:=ActiveCell.Height)

textboxcreated.Name = ActiveCell.Address
Set tBox = textboxcreated.Object
tBox.MultiLine = True
tBox.EnterKeyBehavior = True

End Sub

--
Regards,
Tom Ogilvy


"SSR" wrote in message
...
Hello ,

I have a Worksheet in which I'm Adding Text Box from the Control Toolbox

via
VB Code. What I'm not able to do is to set the Properties of the Textbox

in
the code.
I'm able to change the name as below
Set TextBoxCreated =
ActiveSheet.OLEObjects.Add(ClassType:="Forms.TextB ox.1", Link:=False,
DisplayAsIcon:=False, _
Left:=ActiveCell.Left, _
Top:=ActiveCell.Top, _
Width:=ActiveCell.Width, _
Height:=ActiveCell.Height)

TextBoxCreated.Name = ActiveCell.Address


But What I want to do is to change some more properties like
EnterKeybehavior and MultiLine which I'm unable to do. Can this be

acheived
?
OR Can I Add the TextBox with the EnterkeyBehaviour and Multiline having
values as TRUE insted of the Default FALSE?

Thanks,
SSR




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default OLE Object -TexBox Properties

Hello Tom,
Thanks




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Texbox around selected area Shrikant Excel Discussion (Misc queries) 1 March 6th 10 08:44 PM
Excel: how set default for Format Object Properties to Move and s thejman Setting up and Configuration of Excel 0 September 19th 05 04:29 PM
use value in texbox to search through worksheet GEORGIA Excel Discussion (Misc queries) 0 March 29th 05 08:15 PM
How many CR's in a multi line texbox Mike[_49_] Excel Programming 0 October 26th 03 11:26 PM
iterating through all properties of an object Barney Fife Excel Programming 4 August 22nd 03 03:18 AM


All times are GMT +1. The time now is 05:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"