View Single Post
  #1  
Old March 15th, 2010, 06:19 PM posted to microsoft.public.excel.worksheet.functions
sarndt
external usenet poster
 
Posts: 1
Default Dynamically Adding Textbox To Frame

How do I add a textbox control to a frame object (declared as OLEObject) in
vba code behind a worksheet?

For example, I have tried the following that doesn't work...

Dim objFrame As OleObject
Set objFrame = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Frame .1")
With objFrame
.Object.Controls.Add ClassType:="Forms.Textbox.1"
End With