Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

Anpassung meiner Stoppuhr

Forumthread: Anpassung meiner Stoppuhr

Anpassung meiner Stoppuhr
11.03.2008 16:07:36
gio
Hallo Excel Forum,
mir ist die Luft ausgegangen, brauche Eure Hilfe.
Habe im Internet recherchiert und eine tolle Stoppuhr gefunden
und diese modifiziert. passt soweit.
https://www.herber.de/bbs/user/50644.xls
Nun aber habe ich eine kleine Störung:
- Immer wenn ich auf "Log" drücke hüpft mir die Symbolleiste weiter
Mir ist es nicht gelungen, dass das Fenster an derselben Stelle bleibt
und eine zweite Herausforderung
- Wie kann ich Makro ändern, daß ich Möglichkeit habe 2 dieser Fenster
parallel zu betreiben, da bei Bedarf 2 Messungen parallel laufen sollten
Vielen Dank
gio

Anzeige

5
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
Antwort zu Frage 1
13.03.2008 14:02:40
Beverly
Hi,
ändere bzw. ergänze diesen Codeteil

Public Sub proc_CommandBar()
Dim doOben As Double
Dim doLinks As Double
On Error Resume Next
doOben = CommandBars("Stoppuhr").Top
doLinks = CommandBars("Stoppuhr").Left
CommandBars("Stoppuhr").Delete
On Error GoTo 0
Set myCommandBar = CommandBars.Add(Name:="Stoppuhr", _
Position:=msoBarFloating, Temporary:=True)
myCommandBar.Top = doOben
myCommandBar.Left = doLinks




Anzeige
AW: Antwort zu Frage 1
13.03.2008 16:45:00
gio
Hallo Beverly,
Danke erst mal
geht aber nicht
kommt "with Blockvariable nicht festgelegt"
Gruß
gio
Public Sub proc_CommandBar()
Dim doOben As Double
Dim doLinks As Double
On Error Resume Next
doOben = CommandBars("Stoppuhr").Top
doLinks = CommandBars("Stoppuhr").Left
CommandBars("Stoppuhr").Delete
On Error GoTo 0
Set myCommandBar = CommandBars.Add(Name:="Stoppuhr", _
Position:=msoBarFloating, Temporary:=True)
myCommandBar.Top = doOben
myCommandBar.Left = doLinks
' On Error Resume Next
' CommandBars("Stoppuhr").Delete
' On Error GoTo 0
' Set myCommandBar = CommandBars.Add(Name:="Stoppuhr", _
' Position:=msoBarFloating, Temporary:=True)
Set myCommandBarButton1 = myCommandBar.Controls.Add(Type:=msoControlButton)
With myCommandBarButton1
.Caption = "Start"
.Style = msoButtonCaption
.OnAction = "proc_Start"
End With
Set myCommandBarButton2 = myCommandBar.Controls.Add(Type:=msoControlButton)
With myCommandBarButton2

Anzeige
AW: Antwort zu Frage 1
13.03.2008 17:28:09
Beverly
Hi,
welche Excel-Version verwendest du? Ich hatte es in 2003 getestet und es lief ohne Fehler. In 2002 kommt der selbe Fehler wie bei dir. Ergänze den Code vor End Sub durch diese Zeile

DoEvents




Anzeige
AW: Antwort zu Frage 1
14.03.2008 07:43:41
gio
Hallo Beverly,
habe Code geändert und "DoEvent" wie gesagt rein getan.
Geht nicht.
Meine Version Excel 2000
Danke
gio

Public Sub proc_CommandBar()
Dim doOben As Double
Dim doLinks As Double
On Error Resume Next
doOben = CommandBars("Stoppuhr").Top
doLinks = CommandBars("Stoppuhr").Left
CommandBars("Stoppuhr").Delete
On Error GoTo 0
Set myCommandBar = CommandBars.Add(Name:="Stoppuhr", _
Position:=msoBarFloating, Temporary:=True)
myCommandBar.Top = doOben
myCommandBar.Left = doLinks
'    On Error Resume Next
'    CommandBars("Stoppuhr").Delete
'    On Error GoTo 0
'    Set myCommandBar = CommandBars.Add(Name:="Stoppuhr", _
'        Position:=msoBarFloating, Temporary:=True)
Set myCommandBarButton1 = myCommandBar.Controls.Add(Type:=msoControlButton)
With myCommandBarButton1
.Caption = "Start"
.Style = msoButtonCaption
.OnAction = "proc_Start"
End With
Set myCommandBarButton2 = myCommandBar.Controls.Add(Type:=msoControlButton)
With myCommandBarButton2
.Caption = "Stop"
.Style = msoButtonCaption
.OnAction = "proc_Stop"
.Enabled = False
End With
Set myCommandBarButton3 = myCommandBar.Controls.Add(Type:=msoControlButton)
With myCommandBarButton3
.Caption = "Log"
.Style = msoButtonCaption
.OnAction = "proc_Lap"
.Enabled = False
End With
Set myCommandBarButton4 = myCommandBar.Controls.Add(Type:=msoControlButton)
With myCommandBarButton4
.Caption = "Reset"
.Style = msoButtonCaption
.OnAction = "proc_Reset"
.Enabled = False
End With
Set myCommandBarButton5 = myCommandBar.Controls.Add(Type:=msoControlButton)
With myCommandBarButton5
.Caption = "00:00:00"
.Style = msoButtonCaption
.TooltipText = "Zeit"
.BeginGroup = True
End With
With myCommandBar
.Protection = msoBarNoChangeDock + msoBarNoCustomize + _
msoBarNoHorizontalDock + msoBarNoResize + msoBarNoVerticalDock
.Visible = True
End With
DoEvents
End Sub


Anzeige
AW: Antwort zu Frage 1
14.03.2008 16:26:00
Beverly
Hi,
ich habe es jetzt in 2000 mit diesem Code problemlos getestet

Public Sub proc_CommandBar()
Dim doOben As Double
Dim doLinks As Double
On Error Resume Next
doOben = CommandBars("Stoppuhr").Top
doLinks = CommandBars("Stoppuhr").Left
CommandBars("Stoppuhr").Delete
On Error GoTo 0
Set myCommandBar = CommandBars.Add(Name:="Stoppuhr", _
Position:=msoBarFloating, Temporary:=True)
myCommandBar.Top = doOben
myCommandBar.Left = doLinks
Set myCommandBarButton1 = myCommandBar.Controls.Add(Type:=msoControlButton)
With myCommandBarButton1
.Caption = "Start"
.Style = msoButtonCaption
.OnAction = "proc_Start"
End With
Set myCommandBarButton2 = myCommandBar.Controls.Add(Type:=msoControlButton)
With myCommandBarButton2
.Caption = "Stop"
.Style = msoButtonCaption
.OnAction = "proc_Stop"
.Enabled = False
End With
Set myCommandBarButton3 = myCommandBar.Controls.Add(Type:=msoControlButton)
With myCommandBarButton3
.Caption = "Log"
.Style = msoButtonCaption
.OnAction = "proc_Lap"
.Enabled = False
End With
Set myCommandBarButton4 = myCommandBar.Controls.Add(Type:=msoControlButton)
With myCommandBarButton4
.Caption = "Reset"
.Style = msoButtonCaption
.OnAction = "proc_Reset"
.Enabled = False
End With
Set myCommandBarButton5 = myCommandBar.Controls.Add(Type:=msoControlButton)
With myCommandBarButton5
.Caption = "00:00:00"
.Style = msoButtonCaption
.TooltipText = "Zeit"
.BeginGroup = True
End With
With myCommandBar
.Protection = msoBarNoChangeDock + msoBarNoCustomize + _
msoBarNoHorizontalDock + msoBarNoResize + msoBarNoVerticalDock
.Visible = True
End With
DoEvents
End Sub




Anzeige
;

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Entdecke mehr
Finde genau, was du suchst

Die erweiterte Suchfunktion hilft dir, gezielt die besten Antworten zu finden

Suche nach den besten Antworten
Unsere beliebtesten Threads

Entdecke unsere meistgeklickten Beiträge in der Google Suche

Top 100 Threads jetzt ansehen
Anzeige