Hi Everyone,
I often use the following code to query named ranges in sheets (in Excel) using SQL (instead of cell references). I find that this dramatically streamlines what I am doing. Here is a short example …
Dim daodb As DAO.Database
Dim rsReg As Recordset
Set daodb = OpenDatabase(ActiveWorkbook.Path & "\" & ActiveWorkbook.Name, False, True, "Excel 8.0;")
Set rsReg = daodb.OpenRecordset("SELECT Reg_To FROM RegTrans WHERE Reg_From='" & strFrom & "'")
rsReg.MoveFirst
RegTrans = rsReg!Reg_To
rsReg.Close
daodb.Close
I would like to duplicate this functionality in a LibreOffice module but have so far not found the syntax that I need.
I tried importing the VBA and running it but I think this is too tricky for LibreOffice to convert directly.
Can anyone help me with this? Maybe there is a code snippet available?
Many thanks,
Alan Searle
Cologne, Germany