天门白云 发表于 2021-10-31 14:04
Set tebox = ActiveSheet.Shapes.AddOLEObject(ClassType:="Forms.textBox.1", Left:=10, Top:=ActiveCel ...
Sub test()
Set tebox = ActiveSheet.OLEObjects.Add(ClassType:="Forms.textBox.1", Left:=10, Top:=ActiveCell.Top, Width:=100, Height:=200)
With tebox
.Name = "文本框1"
.Object.MultiLine = True
.Object.Text = "这是创建的一个新的文本框"
.Activate
End With
End Sub