[de-users] Re: Problem bei der Maro-Programmierung

2009-07-01 Diskussionsfäden Andreas Saeger

Versuch mal folgendes:
=HYPERLINK(vnd.sun.star.script:Library1.Module1.Main?language=Basiclocation=documents=TABELLE()r=ZEILE()c=SPALTE();MACRO)
und formatiere die Zelle, dass sie wie eine Schaltfläche aussieht.

REM ###BASIC###
REM Library1.Module1
Sub Main(sURL$)
iSh=cInt(getArgumentFromURL(sURL,s)) -1
iRow=cInt(getArgumentFromURL(sURL,r)) -1
iCol=cInt(getArgumentFromURL(sURL,c)) -1
oCell = ThisComponent.Sheets(iSh).getCellByPosition(iCol, iRow)
print Hallo Welt, Dein  oCell.AbsoluteAddress
End Sub

Function getArgumentFromURL(sURL$,sName$) as String
on error goto exitErr:
Dim iStart%, i%, l%, sArgs$, a()
iStart = instr(sURL, ?)
l = len(sName)
if (iStart = 0) or (l = 0) then exit function
' sArgs behind ?:
sArgs = mid(sURL, iStart +1)
a() = split(sArgs, )
for i = 0 to uBound(a())
' not case sensitive:
if instr(1, a(i), sName =, 1) = 1 then
getArgumentFromURL = mid(a(i), l +2)
exit for
endif
next
exitErr:
' return 
End Function


-
To unsubscribe, e-mail: users-unsubscr...@de.openoffice.org
For additional commands, e-mail: users-h...@de.openoffice.org



[de-users] Re: Problem bei der Maro-Programmierung

2009-07-01 Diskussionsfäden Andreas Saeger

Andreas Saeger wrote:

Versuch mal folgendes:
=HYPERLINK(vnd.sun.star.script:Library1.Module1.Main?language=Basiclocation=documents=TABELLE()r=ZEILE()c=SPALTE();MACRO) 


und formatiere die Zelle, dass sie wie eine Schaltfläche aussieht.



Uuups, falsche Zwischenablage. Bitte Main(sURL) ersetzen:

Sub Main(sURL$)
iSh=cInt(getArgumentFromURL(sURL,s)) -1
iRow=cInt(getArgumentFromURL(sURL,r)) -1
iCol=cInt(getArgumentFromURL(sURL,c)) -1
oCell = ThisComponent.Sheets(iSh).getCellByPosition(iCol, iRow)
print Hallo Welt, Dein  oCell.AbsoluteName
End Sub


Function getArgumentFromURL(sURL$,sName$) as String
on error goto exitErr:
Dim iStart%, i%, l%, sArgs$, a()
iStart = instr(sURL, ?)
l = len(sName)
if (iStart = 0) or (l = 0) then exit function
' sArgs behind ?:
sArgs = mid(sURL, iStart +1)
a() = split(sArgs, )
for i = 0 to uBound(a())
' not case sensitive:
if instr(1, a(i), sName =, 1) = 1 then
getArgumentFromURL = mid(a(i), l +2)
exit for
endif
next
exitErr:
' return 
End Function



-
To unsubscribe, e-mail: users-unsubscr...@de.openoffice.org
For additional commands, e-mail: users-h...@de.openoffice.org