BASIC runtime error.
An exception occurred 
Type: com.sun.star.task.ErrorCodeIOException
Message: SfxBaseModel::impl_store <file:///D:/Sheet.xls> failed: 0x20d.

on this code

Dim SaveParams(1) As New com.sun.star.beans.PropertyValue
SaveParams(0).Name = "Overwrite"
SaveParams(0).Value = TRUE
SaveParams(1).Name = "FilterName"
SaveParams(1).Value = "MS Excel 97"
Document.storeAsURL(FilePath,SaveParams())

on windows can happen if FilePath already exists and opened THUS LOCKED ON WRITE by OS.

It's too dangerous to go alone, take this: https://github.com/aa6/libreoffice_calc_basic_extras/blob/master/basic_extras_SaveDocAsXLS.bas

Leave a Reply

*