| View previous topic :: View next topic |
| Author |
Message |
patel Power User

Joined: 14 Apr 2012 Posts: 54 Location: Italy
|
Posted: Thu May 24, 2012 5:27 am Post subject: save sheets as separate calc documents (no csv) |
|
|
How can I do ? _________________ If your problem has been solved please add "[Solved]" to the beginning of your first post title (edit button).
Last edited by patel on Sat May 26, 2012 2:51 am; edited 3 times in total |
|
| Back to top |
|
 |
patel Power User

Joined: 14 Apr 2012 Posts: 54 Location: Italy
|
Posted: Fri May 25, 2012 2:11 am Post subject: |
|
|
I tried with this, but it saves documents with all the sheets
| Code: |
Sub saveSheets
cFolder = "C:\...............\"
oDoc=thiscomponent
oSheets = oDoc.Sheets()
aSheetNames = oSheets.getElementNames()
For index=1 to oSheets.getCount() -1
oSheet = oSheets.getByIndex(index)
cNewFileName = aSheetNames(index)
cNewFileName = Replace(cNewFileName, " ", "_")
oController = oDoc.GetCurrentController()
oController.SetActiveSheet(oSheet)
oDoc.StoreToURL( ConvertToUrl( cFolder + cNewFileName + ".ods" ), Array() )
Next index
'oDoc.dispose()
End Sub |
_________________ If your problem has been solved please add "[Solved]" to the beginning of your first post title (edit button). |
|
| Back to top |
|
 |
|