Created
June 3, 2017 03:30
-
-
Save se1exin/2a599e4fec8c62b84102b16eabec7780 to your computer and use it in GitHub Desktop.
Macro for LibreOffice Calc - Export all sheets to CSV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM ***** BASIC ***** | |
Sub Sheets_To_CSV | |
sheets=ThisComponent.Sheets.createEnumeration() | |
sURL = ThisComponent.getURL() | |
oView = ThisComponent.getCurrentController() | |
while sheets.hasMoreElements() | |
sh=sheets.nextElement() | |
s=sh.getName() | |
if sh.IsVisible then | |
oView.setActiveSheet(sh) | |
StoreCSV sURL &"_"& s &".csv" | |
endif | |
wend | |
End Sub | |
sub StoreCSV(sURL As String) | |
dim document as object | |
document = ThisComponent | |
dim args(1) as new com.sun.star.beans.PropertyValue | |
args(0).Name = "FilterName" | |
args(0).Value = "Text - txt - csv (StarCalc)" | |
args(1).Name = "FilterOptions" | |
args(1).Value = "44,34,76,1" | |
document.storeToURL(sURL,args) | |
end sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment