Public Function CreateControl(ControlName As String)
If Not EmbeddedControl Is Nothing Then
Controls.Remove "Embedded"
Set EmbeddedControl = Nothing
End If
' Error will be raised here if control doesn't load
Set EmbeddedControl = Me.Controls.Add(ControlName, "Embedded")
EmbeddedControl.Visible = True
Form_Resize
End Function
Private Sub Form_Resize()
On Error Resume Next
EmbeddedControl.Move 0, 0, ScaleWidth, ScaleHeight
End Sub
|