Vincenzo Giuliano wrote:
> Hi ALL,
> I come to a conclusion.
> This code start a .xls file (if it exists).
> I accept any advice.
(snip)
> Runtime r = Runtime.getRuntime();
> Process p = r.exec("soffice -calc "+urlExcelFile);
If this loads the file into Calc while loading it with the Excel filter
name in the API call doesn't I'm sure the file isn't an Excel file at
all. It doesn't need to be corrupted (I doubt it is), it most probably
is a text or HTML file. It's a bad habit to give text or HTML files an
"xls" extension and so direct Windows to load it into Excel.
So the Excel filter name you provide in the API call is wrong (because
the file isn't an Excel file at all) and OOo then ignores the filter
name and proceeds as if it wouldn't have been there, thus detecting the
file type by itself.
Because OOo uses the extension of the file only as a suggestion for the
type it finds out that the file in reality is a text file (or an HTML
file) and so automatically opens it in Writer.
OOo2.0 can be forced by command line to load files into one of its
applications (here: "-Calc" redirects the file to Calc), of course only
if possible. That's the reason why it works with the command line you
have shown above.
Best regards,
Mathias
--
Mathias Bauer - OpenOffice.org Application Framework Project Lead
Please reply to the list only, [EMAIL PROTECTED] is a spam sink.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]