Hi All
Have new requirement about operations in libreoffice macro with Excel file
Requirement : Open Excel file but not First sheet, I want to open 2nd or 3rd or 4th
How to open ?
Currently I am using below code to open excel file (first sheet)
Sub Macroexcel
Dim iFName As String
Dim iDoc As Variant
Dim oFName As String
Dim oDoc As Variant
Dim cSheet As Variant
Dim sUrl As String
Dim i As Long
Dim maxSize As Long
Dim OpenProp(1) as New com.sun.star.beans.PropertyValue
OpenProp(0).name="FilterName"
OpenProp(0).value="MS Excel"
GlobalScope.BasicLibraries.LoadLibrary("Tools")
iFName = "D:\Amazon\Andere.xlsm"
oFName = "D:\Amazon\Amazon_output.csv"
sUrl = convertToURL(iFName)
If Not FileExists(sUrl) Then Exit Sub
iDoc = stardesktop.LoadComponentFromURL(sUrl, "_blank",0, OpenProp())
Dim oCursor As Variant
Dim iDataArray As Variant
Dim iD As Variant
cSheet = iDoc.getSheets().getByIndex(0)
oCursor = cSheet.createCursor()
oCursor.gotoEndOfUsedArea(True)
iDataArray = oCursor.getDataArray()
..... more
I want to open “Beispiel” sheet
Thanks in advance