Ole-Object Performance Problem
07.12.2005 14:16:13
alex
ich hab eine Routine geschrieben, die in eine bestimmte Zelle eine MS-Forms Textbox einfügt. Auf 5 Rechnern läuft meine Applikation ohne Probleme, aber bei einem Rechner braucht er für das Einfügen einer Textbox ca. 5 Sekunden. Die Applikation erstellt aber ca. 50 Textboxen. Excel de- und installieren hab ich schon gemacht - bringt nix :-(
Hat Irgendjemand eine Idee dazu? Scheint sicherlich ein Betriebssystemproblem zu sein.
Sub textbox_einfügen(r As Range)
Dim sh As Worksheet
Dim txt As TextBox
Dim s As Shape
Dim v As OLEObject
Set sh = r.Worksheet
Set s = sh.Shapes.AddOLEObject("Forms.Textbox.1", , , , , , , r.Left + 1, r.Top + 1, r.Width - 1, r.Height - 1)
Set v = sh.OLEObjects(s.Name)
v.LinkedCell = r.Cells(1, 1).Address
v.Placement = xlMoveAndSize
v.Object.MultiLine = True
v.Object.ScrollBars = 2
v.Object.BorderStyle = 0
v.Object.SpecialEffect = 0
v.Object.EnterKeyBehavior = True
End Sub
MfG,
Alex E.