I have a script in StarBasic that find some data, then open a file and should wait for the user's input (move the cursor to the desired destination of the data), then write the data.
I don't have idea on how to do this.
I append the macro.
Thanks in advance.
Sergio

REM  *****  BASIC  *****
Dim vData as Variant
Dim Ccount as Integer
Sub Main
oCalc = ThisComponent
StarDesktop.loadComponentFromUrl(UrlFile,"_blank",0,array())
DataFinder(oCalc,1)
for l = 0 to Ccount
   MsgBox ("Place the cursor where will be the " & vData(l) )
next

End Sub

Function UrlFile
oFilePicker = createUnoService ("com.sun.star.ui.dialogs.FilePicker")
oFilePicker.execute
Url = oFilePicker.getSelectedFiles
UrlFile = Url(0)
End Function

Function DataFinder(oCalc, Optional Row)
oSel = oCalc.CurrentSelection
if Row then
   Rcount = Row-1
else
   Rcount = oSel.rows.count-1
endif
Ccount = oSel.columns.count-1
aData = oSel.getDataArray
for i = 0 to Rcount
   vData = aData(i)
next
End Function

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to