Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default What's wrong with this?

In VBA Code behind a worksheet

Dim objFrame As OleObject
Dim objTextBox As OLEObject

Set objFrame = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Frame .1")
Set objTextBox =
ActiveSheet.OLEObjects(objFrame).Add(ClassType:="F orms.Textbox.1")

Frame is created. But Textbox statement errors out - and doesn't get
created inside of Frame

Thanks

Steve
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default What's wrong with this?

The Forms Toolbar does not have a TextBox control on it... you will need to
use either the one from the Drawing Toolbar or from the Control Toolbox
Toolbar instead.

--
Rick (MVP - Excel)


"sarndt" wrote in message
...
In VBA Code behind a worksheet

Dim objFrame As OleObject
Dim objTextBox As OLEObject

Set objFrame = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Frame .1")
Set objTextBox =
ActiveSheet.OLEObjects(objFrame).Add(ClassType:="F orms.Textbox.1")

Frame is created. But Textbox statement errors out - and doesn't get
created inside of Frame

Thanks

Steve


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default What's wrong with this?

Rick

Thanks for the info. Everytime I try to use the MSForms.Frame and Textbox,
I get the Cannot Install Object error. I've tried various recommendations
from the Internet to fix the problem but none have worked so far. I keep
working on it.

Steve

"sarndt" wrote:

In VBA Code behind a worksheet

Dim objFrame As OleObject
Dim objTextBox As OLEObject

Set objFrame = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Frame .1")
Set objTextBox =
ActiveSheet.OLEObjects(objFrame).Add(ClassType:="F orms.Textbox.1")

Frame is created. But Textbox statement errors out - and doesn't get
created inside of Frame

Thanks

Steve

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default What's wrong with this?

Well - I've played with this further. I can add a control toolbox frame to
the worksheet in display mode, but I can't add it using the code below in the
Worksheet_change event where I trying to add the frame.

Set objFrame = Activesheet.OLEObjects.Add(classtype:="MSForms.Fra me")

Steve

=================

"sarndt" wrote:

In VBA Code behind a worksheet

Dim objFrame As OleObject
Dim objTextBox As OLEObject

Set objFrame = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Frame .1")
Set objTextBox =
ActiveSheet.OLEObjects(objFrame).Add(ClassType:="F orms.Textbox.1")

Frame is created. But Textbox statement errors out - and doesn't get
created inside of Frame

Thanks

Steve

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default What's wrong with this?

Try this


Dim objFrame As Frame
Dim objTextBox As Control

Set objFrame = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Frame .1").Object
Set objTextBox = objFrame.Controls.Add("Forms.Textbox.1")




On 3/17/2010 12:50 PM, sarndt wrote:
Well - I've played with this further. I can add a control toolbox frame to
the worksheet in display mode, but I can't add it using the code below in the
Worksheet_change event where I trying to add the frame.

Set objFrame = Activesheet.OLEObjects.Add(classtype:="MSForms.Fra me")

Steve

=================

"sarndt" wrote:

In VBA Code behind a worksheet

Dim objFrame As OleObject
Dim objTextBox As OLEObject

Set objFrame = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Frame .1")
Set objTextBox =
ActiveSheet.OLEObjects(objFrame).Add(ClassType:="F orms.Textbox.1")

Frame is created. But Textbox statement errors out - and doesn't get
created inside of Frame

Thanks

Steve


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
What do I do wrong [Excuses pushing the wrong key combination earlier] Vsn Excel Programming 7 November 8th 09 09:12 PM
Is there something wrong with this? Solution4U Excel Programming 2 October 10th 08 07:10 PM
What's wrong with this ?? Eric @ BP-EVV Excel Programming 3 August 26th 08 09:59 PM
Insert Calculated Field (wrong Qty*Price = wrong Amount) Edmund Excel Discussion (Misc queries) 8 October 4th 07 12:13 PM
Please Tell Me What I Am Doing Wrong kidd Excel Programming 0 October 30th 04 01:30 AM


All times are GMT +1. The time now is 08:47 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"