Ask Your Question

Can I use the -convert-to, or is there any other way, to convert a worksheet in an xls into csv [closed]

asked 2015-04-20 10:06:54 +0200

jobzombi gravatar image

updated 2020-08-20 12:19:21 +0200

Alex Kemp gravatar image

Currently, the -convert-to parameter can be used to convert an xls into a csv file, but it can only do so with the front worksheet. I have come to need the converting of a specific worksheet in a workbook. Can this be done with the CLI parameters, or is there another way to do so?

Currently I have excel and LO installed, so for such needs I run a vbs script that opens a hidden session of excel, switches to the appropriate worksheet and then saves it as a csv file with semicolon delimiters.

If LO does not have a parameter for that, is there a way to do what I currently do with excel but with LO Calc?

This is the VBS I use:

Const xlCSV = 6

Set objExcel = CreateObject("Excel.Application")


objExcel.DisplayAlerts = FALSE
objExcel.Visible = FALSE

Set objExcelWorkbook = objExcel.ActiveWorkbook

objExcelWorkbook.Worksheets("Sheet Name").Activate

objExcelWorkbook.SaveAs "destination.csv", xlCSV, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1


I am not sure how to even create an object that opens LO Calc.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2020-08-20 12:20:02.351037

1 Answer

Sort by » oldest newest most voted

answered 2015-04-20 10:33:55 +0200

ROSt52 gravatar image

updated 2015-04-20 10:34:26 +0200

Why don't you just open your csv-file with Calc. There is a wizard in Calc for opening csv-files. Once thereafter you can save it as and odt-file, which automatically makes it a workbook.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-04-20 10:06:54 +0200

Seen: 162 times

Last updated: Apr 20 '15