von Jörg » Mo, 22.12.2014 22:04
hallo balu und clag,
hier mal der "verbesserte" Code zum Wiederhestellen der Formeln zum Aufruf der bestehenden Kundendaten.
Code: Alles auswählen
'
' ##########################################################################################################
'
sub showColumnF
myDoc = thisComponent
mySheet = myDoc.sheets(1)
myView = myDoc.CurrentController
mycell = mysheet.getCellRangebyName("$E$8")
mycell.formulalocal="='Eingabemaske Abr_Rechnung'.C10"
mycell = mysheet.getCellRangebyName("$E$9")
mycell.formulalocal= "=WENN(ZÄHLENWENN(Patientendatei.$A$2:$A$5000;$E$8);SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C9;Patientendatei.$A$1:$J$1;0);0);"""")"
mycell = mysheet.getCellRangebyName("$E$10")
mycell.formulalocal= "=WENN(ZÄHLENWENN(Patientendatei.$A$2:$A$5000;$E$8);SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C10;Patientendatei.$A$1:$J$1;0);0);"""")"
mycell = mysheet.getCellRangebyName("$E$11")
mycell.formulalocal= "=WENN(ZÄHLENWENN(Patientendatei.$A$2:$A$5000;$E$8);SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C11;Patientendatei.$A$1:$J$1;0);0);"""")"
mycell = mysheet.getCellRangebyName("$E$12")
mycell.formulalocal= "=WENN(ZÄHLENWENN(Patientendatei.$A$2:$A$5000;$E$8);SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C12;Patientendatei.$A$1:$J$1;0);0);"""")"
mycell = mysheet.getCellRangebyName("$E$13")
mycell.formulalocal= "=WENN(ZÄHLENWENN(Patientendatei.$A$2:$A$5000;$E$8);SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C13;Patientendatei.$A$1:$J$1;0);0);"""")"
mycell = mysheet.getCellRangebyName("$E$14")
mycell.formulalocal= "=WENN(ZÄHLENWENN(Patientendatei.$A$2:$A$5000;$E$8);SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C14;Patientendatei.$A$1:$J$1;0);0);"""")"
mycell = mysheet.getCellRangebyName("$E$15")
mycell.formulalocal= "=WENN(ZÄHLENWENN(Patientendatei.$A$2:$A$5000;$E$8);SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C15;Patientendatei.$A$1:$J$1;0);0);"""")"
mycell = mysheet.getCellRangebyName("$E$16")
mycell.formulalocal= "=WENN(ZÄHLENWENN(Patientendatei.$A$2:$A$5000;$E$8);SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C16;Patientendatei.$A$1:$J$1;0);0);"""")"
mycell = mysheet.getCellRangebyName("$E$17")
mycell.formulalocal= "=WENN(ZÄHLENWENN(Patientendatei.$A$2:$A$5000;$E$8);SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C17;Patientendatei.$A$1:$J$1;0);0);"""")"
for i=0 to 8
mysheet.getCellByPosition(5,8+i).string =""
next
oSpalte = mySheet.getcolumns().getByIndex(5)
oSpalte.isVisible = true
mycell = mysheet.getCellByPosition(5,8)
myView.Select(mycell)
oForm = mySheet.drawpage.forms.getbyindex(0)
oControl = oForm.getByName("Schaltfläche 1")
oControl.enablevisible = false
oControl = oForm.getByName("Schaltfläche 2")
oControl.enablevisible = false
oControl = oForm.getByName("Schaltfläche 4")
oControl.enablevisible = false
oControl = oForm.getByName("Schaltfläche 7")
oControl.enablevisible = false
oControl = oForm.getByName("Schaltfläche 5")
oControl.enablevisible = true
oControl = oForm.getByName("Schaltfläche 6")
oControl.enablevisible = true
end sub
'
' ############################################################################
'
Zum Vergleich der Alte Code:
Code: Alles auswählen
sub showColumnF
myDoc = thisComponent
mySheet = myDoc.sheets(1)
mycell = mysheet.getCellrangebyName("E8")
mycell.Formula = "='Eingabemaske Abr_Rechnung'.C10"
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem define variables
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem--------------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ToPoint"
args2(0).Value = "$E$9"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args2())
rem ----------------------------------------------------------------------
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "StringName"
args3(0).Value = "=WENN(ISTNV(SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C9;Patientendatei.$A$1:$J$1;0);0));"""";SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C9;Patientendatei.$A$1:$J$1;0);0))"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args3())
rem--------------------------------------------------------------------------------------------
dim args4(0) as new com.sun.star.beans.PropertyValue
args4(0).Name = "ToPoint"
args4(0).Value = "$E$10"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args4())
rem ----------------------------------------------------------------------
dim args5(0) as new com.sun.star.beans.PropertyValue
args5(0).Name = "StringName"
args5(0).Value = "=WENN(ISTNV(SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C10;Patientendatei.$A$1:$J$1;0);0));"""";SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C10;Patientendatei.$A$1:$J$1;0);0))"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args5())
rem-------------------------------------------------------------------------------
dim args6(0) as new com.sun.star.beans.PropertyValue
args6(0).Name = "ToPoint"
args6(0).Value = "$E$11"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args6())
rem ----------------------------------------------------------------------
dim args7(0) as new com.sun.star.beans.PropertyValue
args7(0).Name = "StringName"
args7(0).Value = "=WENN(ISTNV(SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C11;Patientendatei.$A$1:$J$1;0);0));"""";SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C11;Patientendatei.$A$1:$J$1;0);0))"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args7())
rem------------------------------------------------------------------------------
dim args8(0) as new com.sun.star.beans.PropertyValue
args8(0).Name = "ToPoint"
args8(0).Value = "$E$12"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args8())
rem ----------------------------------------------------------------------
dim args9(0) as new com.sun.star.beans.PropertyValue
args9(0).Name = "StringName"
args9(0).Value = "=WENN(ISTNV(SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C12;Patientendatei.$A$1:$J$1;0);0));"""";SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C12;Patientendatei.$A$1:$J$1;0);0))"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args9())
rem-------------------------------------------------------------------------
dim args10(0) as new com.sun.star.beans.PropertyValue
args10(0).Name = "ToPoint"
args10(0).Value = "$E$13"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args10())
rem ----------------------------------------------------------------------
dim args11(0) as new com.sun.star.beans.PropertyValue
args11(0).Name = "StringName"
args11(0).Value = "=WENN(ISTNV(SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C13;Patientendatei.$A$1:$J$1;0);0));"""";SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C13;Patientendatei.$A$1:$J$1;0);0))"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args11())
rem-------------------------------------------------------------------------
dim args12(0) as new com.sun.star.beans.PropertyValue
args12(0).Name = "ToPoint"
args12(0).Value = "$E$14"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args12())
rem ----------------------------------------------------------------------
dim args13(0) as new com.sun.star.beans.PropertyValue
args13(0).Name = "StringName"
args13(0).Value = "=$M$14"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args13())
rem-------------------------------------------------------------------------
dim args14(0) as new com.sun.star.beans.PropertyValue
args14(0).Name = "ToPoint"
args14(0).Value = "$E$15"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args14())
rem ----------------------------------------------------------------------
dim args15(0) as new com.sun.star.beans.PropertyValue
args15(0).Name = "StringName"
args15(0).Value = "=WENN(ISTNV(SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C15;Patientendatei.$A$1:$J$1;0);0));"""";SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C15;Patientendatei.$A$1:$J$1;0);0))"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args15())
rem-------------------------------------------------------------------------
dim args16(0) as new com.sun.star.beans.PropertyValue
args16(0).Name = "ToPoint"
args16(0).Value = "$E$16"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args16())
rem ----------------------------------------------------------------------
dim args17(0) as new com.sun.star.beans.PropertyValue
args17(0).Name = "StringName"
args17(0).Value = "=WENN(ISTNV(SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C16;Patientendatei.$A$1:$J$1;0);0));"""";SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C16;Patientendatei.$A$1:$J$1;0);0))"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args17())
rem-------------------------------------------------------------------------
dim args18(0) as new com.sun.star.beans.PropertyValue
args18(0).Name = "ToPoint"
args18(0).Value = "$E$17"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args18())
rem ----------------------------------------------------------------------
dim args19(0) as new com.sun.star.beans.PropertyValue
args19(0).Name = "StringName"
args19(0).Value = "=WENN(ISTNV(SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C17;Patientendatei.$A$1:$J$1;0);0));"""";SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C17;Patientendatei.$A$1:$J$1;0);0))"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args19())
rem get access to the document
myDoc = thisComponent
mySheet = myDoc.sheets(1)
myView = myDoc.CurrentController
for i=0 to 8
mysheet.getCellByPosition(5,8+i).string =""
next
oSpalte = mySheet.getcolumns().getByIndex(5)
oSpalte.isVisible = true
mycell = mysheet.getCellByPosition(5,8)
myView.Select(mycell)
oForm = mySheet.drawpage.forms.getbyindex(0)
oControl = oForm.getByName("Schaltfläche 1")
oControl.enablevisible = false
oControl = oForm.getByName("Schaltfläche 2")
oControl.enablevisible = false
oControl = oForm.getByName("Schaltfläche 4")
oControl.enablevisible = false
oControl = oForm.getByName("Schaltfläche 7")
oControl.enablevisible = false
oControl = oForm.getByName("Schaltfläche 5")
oControl.enablevisible = true
oControl = oForm.getByName("Schaltfläche 6")
oControl.enablevisible = true
end sub
Nochmal vielen Dank für Eure Hilfe und Anregungen
Gruß Jörg
hallo balu und clag,
hier mal der "verbesserte" Code zum Wiederhestellen der Formeln zum Aufruf der bestehenden Kundendaten.
[code]'
' ##########################################################################################################
'
sub showColumnF
myDoc = thisComponent
mySheet = myDoc.sheets(1)
myView = myDoc.CurrentController
mycell = mysheet.getCellRangebyName("$E$8")
mycell.formulalocal="='Eingabemaske Abr_Rechnung'.C10"
mycell = mysheet.getCellRangebyName("$E$9")
mycell.formulalocal= "=WENN(ZÄHLENWENN(Patientendatei.$A$2:$A$5000;$E$8);SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C9;Patientendatei.$A$1:$J$1;0);0);"""")"
mycell = mysheet.getCellRangebyName("$E$10")
mycell.formulalocal= "=WENN(ZÄHLENWENN(Patientendatei.$A$2:$A$5000;$E$8);SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C10;Patientendatei.$A$1:$J$1;0);0);"""")"
mycell = mysheet.getCellRangebyName("$E$11")
mycell.formulalocal= "=WENN(ZÄHLENWENN(Patientendatei.$A$2:$A$5000;$E$8);SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C11;Patientendatei.$A$1:$J$1;0);0);"""")"
mycell = mysheet.getCellRangebyName("$E$12")
mycell.formulalocal= "=WENN(ZÄHLENWENN(Patientendatei.$A$2:$A$5000;$E$8);SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C12;Patientendatei.$A$1:$J$1;0);0);"""")"
mycell = mysheet.getCellRangebyName("$E$13")
mycell.formulalocal= "=WENN(ZÄHLENWENN(Patientendatei.$A$2:$A$5000;$E$8);SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C13;Patientendatei.$A$1:$J$1;0);0);"""")"
mycell = mysheet.getCellRangebyName("$E$14")
mycell.formulalocal= "=WENN(ZÄHLENWENN(Patientendatei.$A$2:$A$5000;$E$8);SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C14;Patientendatei.$A$1:$J$1;0);0);"""")"
mycell = mysheet.getCellRangebyName("$E$15")
mycell.formulalocal= "=WENN(ZÄHLENWENN(Patientendatei.$A$2:$A$5000;$E$8);SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C15;Patientendatei.$A$1:$J$1;0);0);"""")"
mycell = mysheet.getCellRangebyName("$E$16")
mycell.formulalocal= "=WENN(ZÄHLENWENN(Patientendatei.$A$2:$A$5000;$E$8);SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C16;Patientendatei.$A$1:$J$1;0);0);"""")"
mycell = mysheet.getCellRangebyName("$E$17")
mycell.formulalocal= "=WENN(ZÄHLENWENN(Patientendatei.$A$2:$A$5000;$E$8);SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C17;Patientendatei.$A$1:$J$1;0);0);"""")"
for i=0 to 8
mysheet.getCellByPosition(5,8+i).string =""
next
oSpalte = mySheet.getcolumns().getByIndex(5)
oSpalte.isVisible = true
mycell = mysheet.getCellByPosition(5,8)
myView.Select(mycell)
oForm = mySheet.drawpage.forms.getbyindex(0)
oControl = oForm.getByName("Schaltfläche 1")
oControl.enablevisible = false
oControl = oForm.getByName("Schaltfläche 2")
oControl.enablevisible = false
oControl = oForm.getByName("Schaltfläche 4")
oControl.enablevisible = false
oControl = oForm.getByName("Schaltfläche 7")
oControl.enablevisible = false
oControl = oForm.getByName("Schaltfläche 5")
oControl.enablevisible = true
oControl = oForm.getByName("Schaltfläche 6")
oControl.enablevisible = true
end sub
'
' ############################################################################
'[/code]
Zum Vergleich der Alte Code:
[code] sub showColumnF
myDoc = thisComponent
mySheet = myDoc.sheets(1)
mycell = mysheet.getCellrangebyName("E8")
mycell.Formula = "='Eingabemaske Abr_Rechnung'.C10"
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem define variables
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem--------------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ToPoint"
args2(0).Value = "$E$9"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args2())
rem ----------------------------------------------------------------------
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "StringName"
args3(0).Value = "=WENN(ISTNV(SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C9;Patientendatei.$A$1:$J$1;0);0));"""";SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C9;Patientendatei.$A$1:$J$1;0);0))"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args3())
rem--------------------------------------------------------------------------------------------
dim args4(0) as new com.sun.star.beans.PropertyValue
args4(0).Name = "ToPoint"
args4(0).Value = "$E$10"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args4())
rem ----------------------------------------------------------------------
dim args5(0) as new com.sun.star.beans.PropertyValue
args5(0).Name = "StringName"
args5(0).Value = "=WENN(ISTNV(SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C10;Patientendatei.$A$1:$J$1;0);0));"""";SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C10;Patientendatei.$A$1:$J$1;0);0))"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args5())
rem-------------------------------------------------------------------------------
dim args6(0) as new com.sun.star.beans.PropertyValue
args6(0).Name = "ToPoint"
args6(0).Value = "$E$11"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args6())
rem ----------------------------------------------------------------------
dim args7(0) as new com.sun.star.beans.PropertyValue
args7(0).Name = "StringName"
args7(0).Value = "=WENN(ISTNV(SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C11;Patientendatei.$A$1:$J$1;0);0));"""";SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C11;Patientendatei.$A$1:$J$1;0);0))"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args7())
rem------------------------------------------------------------------------------
dim args8(0) as new com.sun.star.beans.PropertyValue
args8(0).Name = "ToPoint"
args8(0).Value = "$E$12"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args8())
rem ----------------------------------------------------------------------
dim args9(0) as new com.sun.star.beans.PropertyValue
args9(0).Name = "StringName"
args9(0).Value = "=WENN(ISTNV(SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C12;Patientendatei.$A$1:$J$1;0);0));"""";SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C12;Patientendatei.$A$1:$J$1;0);0))"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args9())
rem-------------------------------------------------------------------------
dim args10(0) as new com.sun.star.beans.PropertyValue
args10(0).Name = "ToPoint"
args10(0).Value = "$E$13"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args10())
rem ----------------------------------------------------------------------
dim args11(0) as new com.sun.star.beans.PropertyValue
args11(0).Name = "StringName"
args11(0).Value = "=WENN(ISTNV(SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C13;Patientendatei.$A$1:$J$1;0);0));"""";SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C13;Patientendatei.$A$1:$J$1;0);0))"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args11())
rem-------------------------------------------------------------------------
dim args12(0) as new com.sun.star.beans.PropertyValue
args12(0).Name = "ToPoint"
args12(0).Value = "$E$14"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args12())
rem ----------------------------------------------------------------------
dim args13(0) as new com.sun.star.beans.PropertyValue
args13(0).Name = "StringName"
args13(0).Value = "=$M$14"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args13())
rem-------------------------------------------------------------------------
dim args14(0) as new com.sun.star.beans.PropertyValue
args14(0).Name = "ToPoint"
args14(0).Value = "$E$15"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args14())
rem ----------------------------------------------------------------------
dim args15(0) as new com.sun.star.beans.PropertyValue
args15(0).Name = "StringName"
args15(0).Value = "=WENN(ISTNV(SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C15;Patientendatei.$A$1:$J$1;0);0));"""";SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C15;Patientendatei.$A$1:$J$1;0);0))"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args15())
rem-------------------------------------------------------------------------
dim args16(0) as new com.sun.star.beans.PropertyValue
args16(0).Name = "ToPoint"
args16(0).Value = "$E$16"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args16())
rem ----------------------------------------------------------------------
dim args17(0) as new com.sun.star.beans.PropertyValue
args17(0).Name = "StringName"
args17(0).Value = "=WENN(ISTNV(SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C16;Patientendatei.$A$1:$J$1;0);0));"""";SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C16;Patientendatei.$A$1:$J$1;0);0))"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args17())
rem-------------------------------------------------------------------------
dim args18(0) as new com.sun.star.beans.PropertyValue
args18(0).Name = "ToPoint"
args18(0).Value = "$E$17"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args18())
rem ----------------------------------------------------------------------
dim args19(0) as new com.sun.star.beans.PropertyValue
args19(0).Name = "StringName"
args19(0).Value = "=WENN(ISTNV(SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C17;Patientendatei.$A$1:$J$1;0);0));"""";SVERWEIS($E$8;Patientendatei.$A$2:$J$5000;VERGLEICH($C17;Patientendatei.$A$1:$J$1;0);0))"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args19())
rem get access to the document
myDoc = thisComponent
mySheet = myDoc.sheets(1)
myView = myDoc.CurrentController
for i=0 to 8
mysheet.getCellByPosition(5,8+i).string =""
next
oSpalte = mySheet.getcolumns().getByIndex(5)
oSpalte.isVisible = true
mycell = mysheet.getCellByPosition(5,8)
myView.Select(mycell)
oForm = mySheet.drawpage.forms.getbyindex(0)
oControl = oForm.getByName("Schaltfläche 1")
oControl.enablevisible = false
oControl = oForm.getByName("Schaltfläche 2")
oControl.enablevisible = false
oControl = oForm.getByName("Schaltfläche 4")
oControl.enablevisible = false
oControl = oForm.getByName("Schaltfläche 7")
oControl.enablevisible = false
oControl = oForm.getByName("Schaltfläche 5")
oControl.enablevisible = true
oControl = oForm.getByName("Schaltfläche 6")
oControl.enablevisible = true
end sub[/code]
Nochmal vielen Dank für Eure Hilfe und Anregungen
Gruß Jörg