https://bz.apache.org/ooo/show_bug.cgi?id=127395
--- Comment #8 from oooforum (fr) <[email protected]> --- So weird, it seems ActiveSheet not compatible _only_ with CSV filter I try with SYLK export and it works too. I found a workaround with dispatcher help. Sub csvexport Dim sDoc as String Dim Arg(0) As New com.sun.star.beans.PropertyValue Dim Args1(0) as new com.sun.star.beans.PropertyValue Dim Args2(0) as new com.sun.star.beans.PropertyValue Arg(0).Name = "Hidden" Arg(0).Value = True sDoc = ConvertToURL("C:\Temp\export_csv.ods") oDoc = StarDesktop.loadComponentFromURL(sDoc, "_default", 0, Arg() ) 'oSheet = oDoc.sheets.GetByIndex(2) 'oDoc.CurrentController.setActiveSheet(oSheet) ' Workaround with these lines oFrame = oDoc.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") Args1(0).Name = "Tables" Args1(0).Value = Array(2) 'index # for sheet dispatcher.executeDispatch(oFrame, ".uno:SelectTables", "", 0, args1()) Arg2(0).Name = "FilterName" Arg2(0).Value = "Text - txt - csv (StarCalc)" 'Arg2(0).Value = "dBase" outputUrl = ConvertToURL( "C:\Temp\test.csv") 'msgbox oDoc.CurrentController.ActiveSheet.Name oDoc.storeToURL( outputUrl, Arg() ) oDoc.close(true) End Sub I don't know if this issue must be reopen -- You are receiving this mail because: You are the assignee for the issue.
