zu diesem Thema habe ich seit letzter Woche auch ein Problem.
Nich regelmässig aber des öfteren kommt bei ": Fehlermeldung "Eigenschaft/Methode nicht gefunden" jetzt auch. Habe schon verschiedene Ansätze aus dem Forum probiert, aber komme nicht weiter.
Bevor ich alles kaputt mache (meine Gesammtkentnisse sind nicht so berauschend) stelle ich den Code mit einer Testdatei hier ein.
Code: Alles auswählen
REM ***** BASIC *****
REM -----------------------------------------------------------------------------------------
REM Zeit einer *.gpx Datei anpassen Vers. 002
REM ulkohls
REM -----------------------------------------------------------------------------------------
Option Explicit
Sub gpx_Zeit_aendern
'---------------------------------------------------------------------------------------------
' Variablen deklarieren
dim oCalcDokument As Object, oDispatcher As Object
dim oDoc As Object, oTabBlatt As Object, oRange As Object, oZelle As Object
dim oCellCursor As Object, oView As Object, oSheets As Object
dim oZielInput As Object
'---------------------------------------------------------------------------------------------
' Bearbeitungs- Variable
'---------------------------------------------------------------------------------------------
dim nZei As Integer 'Beginn der zu bearbeitenden Zeilen
dim nLetzteZ As Long, nTo As Long
'letze zu bearbeitende Zeile
dim sAbfrage As String 'wichig für die letzte Zeile
'----------------------------------------------------------------------------------------------
dim c As Long, i As Long 'Zähler
dim x As Integer, y As Integer
'-----------------------------------------------------------------------------------------------
dim nSek As Integer, nMinu As Integer, nStun As Integer
dim nSekDif As Integer
dim nZwSek As Integer,nZwMinu As Integer, nZwStun As Integer
dim nBildNull As Variant 'Als Startzeit kleinstmögliche Zeit --> 00:00:01
dim nBildTime As Variant 'Eingabe der Bildaufnahme-Zeit in Zeile Pild-Position
dim ZellName As String
'-----------------------------------------------------------------------------------------------
oCalcDokument = ThisComponent.CurrentController.Frame
Dispatcher = createUnoService( "com.sun.star.frame.DispatchHelper" )
'-----------------------------------------------------------------------------------------------
' Name anzeigen
'MsgBox oTabBlatt
'-----------------------------------------------------------------------------------------------
' Variablen für Until-Schleife belegen
i = 0
nTo = 1
nZei = 1
nBildNull = 0
nBildTime = 0
x = 1
y = 1
' ZellenVariablen belegen
nStun = 0
nMinu = 0
nSek = 0
nZwStun = 0
nZwMinu = 0
nSekDif = 0
nLetzteZ = 0
'-----------------------------------------------------------------------------------------------
oCalcDokument = ThisComponent.CurrentController.Frame
oTabBlatt = oCalcDokument.Sheets(0)
' oView = oCalcDokument.CurrentController
oView.setActiveSheet(oTabBlatt)
oZelle = oTabBlatt.getCellByPosition(4,x)
ZellName = oZelle.string
MsgBox "die Zelle ist: -" & ZellName & "-"
' call Auf_Zelle_Springen()
nBildNull = oZelle.Value
'sAbfrage = InputBox("Letzte Zeilen-Nr. eingeben"," ")
'nLetzteZ = Val(sAbfrage)
nLetzteZ = 10
'MsgBox "die letzteZeile ist: -" &nLetzteZ & "-"
oZelle = oTabBlatt.getCellByPosition(4,x)
nBildNull = oZelle.Value
oZelle = oTabBlatt.getCellByPosition(6,x)
nStun = oZelle.Value
oZelle = oTabBlatt.getCellByPosition(7,x)
nMinu = oZelle.Value
oZelle = oTabBlatt.getCellByPosition(8,x)
nSek = oZelle.Value
do until x = nLetzteZ
for y = 1 to nTo
oZelle = oTabBlatt.getCellByPosition(4,(x +1))
nBildTime = oZelle.Value
oZelle = oTabBlatt.getCellByPosition(6,(x +1))
nZwStun = oZelle.Value
msgBox x &" Zeile "& nStun &" hh "& nMinu &" min "& nSek &" sek + Diff-Sek "& nSekDif
oZelle = oTabBlatt.getCellByPosition(9,(x+1))
nSekDif = oZelle.Value
oZelle = oTabBlatt.getCellByPosition(7,x)
msgBox x &" Zeile "& nStun &" hh "& nMinu &" min "& nSek &" sek + Diff-Sek "& nSekDif
if nSek + nSekDif >= 60 Then
oZelle = oTabBlatt.getCellByPosition(7,x)
nSek = nSek - 60
nMinu = nMinu +1
if nMinu >= 60 Then
x = x +1
oZelle = oTabBlatt.getCellByPosition(6,x)
nStun = nStun +1
oZelle.Value = nStun
x = x -1
nMinu = nMinu -60
end if
endif
x = x +1
if nBildTime > nBildNull Then
oZelle = oTabBlatt.getCellByPosition(6,x)
nStun = oZelle.Value
oZelle = oTabBlatt.getCellByPosition(7,x)
nMinu = oZelle.Value
oZelle = oTabBlatt.getCellByPosition(7,x)
nSek = oZelle.Value
Endif
nSek = nSek + nSekDif
oZelle = oTabBlatt.getCellByPosition(6,x)
oZelle.Value = nStun
oZelle = oTabBlatt.getCellByPosition(7,x)
oZelle.Value = nMinu
oZelle = oTabBlatt.getCellByPosition(8,x)
oZelle.Value = nSek
nZei = nZei
y = y +1
if nZei > nLetzteZ then exit sub
next y
loop
End Sub
Arbeite seit Dez. 2016 sehr gut mit diesem Makro. Ab Januar 2018 lief mein Rechner nach Umstellung des Internetzugangs von Unity Media auf Telekom immer schlechter. Weiil das letzte win 10 Update immer wieder hängen blieb und nach einem Neustart rückgängig gemacht wurde, habe ich alles neu aufsetzen müssen. Eine Heidenarbei für mich als Laie.
Da ich den o.g. Ärger schnellsten beheben möchte brauche ich eure Hilfe.
Grüße Ulrich