In Windows, you can right-click on an html file and open it with Calc. Unfortunately, it opens in Writer but in Calc, the file opens fine. Is there a way to open an html file from the OS in Calc?
Because the HTML files basicly are textual documents. HTML = HyperTEXT Markup Language)
If you want to put a HTML table into a Calc document, then you can try to Copy-Paste (or the Copy-Paste special) feature from the Writer or from the Browser.
Surely nobody would open Calc and then Copy-Paste from Writer rather than Open it directly from Calc.
.
Windows starts Calc which then seems to pass the document to a general LibreOffice loader that determines it is a Writer document. I suppose I’m asking how to get a loader to open Calc and then get Calc to open the document.
I have not tested this, but it should be possible to set the infilter by command-line option as described in help (see link below) to "HTML (StarCalc)"
If this works from command-line the next step is to add this parameter to the command, wich is called for the file. It is possible to alter commands inside the icon, but this would have to be repeated for every file…
Maybe I’d create a simple batch/script, wich would call Calc with the necessary parameter and try to register this in the context-menu for .html
One problem is, we should not change this globally (for all html-files), as most will not be suited for Calc.
Update: For command-line it was not necessary to set the filter. All it needs is a call to scalc.exe to open the file with calc .
I also changed the extension to .htmtab (as I don’t wish to change for all .html-files) and then select at the open-with context-menu the scalc.exe from its folder. File was then opened in calc directly. Even without setting this as default, Calc is now the first choice in the context menu for the .htmtab-file.
.
Test on a Win10 Home 22H2 64bit with LibreOffice 7.2.6.2 (x86) 32bit.
Update2: I guess a double click on the icon starts not calc, but soffice.exe
, wich then decides to give text/html-type to writer/web.
.
Command-line call of soffice.exe with --infilter (as suggested above) opened my html-table in calc.
@Wanderer That’s great info. I agree the calc icon in the file associations seems to load with soffice.
Just add another file association using C:\Program Files\LibreOffice\program\scalc.exe
and open with right-click.
One hint for later readers:
this path works for 64bit LibreOffice on 64bit Windows (and 32bit LibreOffice on older 32bit Windows), if one uses defaults, but 32bit LibreOffice on 64bit Windows or portable Installations use a different path.
Yes there is (as described in comments): You have to select scalc.exe
from its folder when you use the Context-menu “Open with”.
Unfortunatly there is not much visual difference in the List between soffice.exe and scalc.exe, so for setting scalc as default, there is no problem. But for occasional use you have to know “the icon with blue background is scalc”. As you use this, Windows wil remember. So my html-file has 3 new Options now at open-with: Two for “LibreOffice” (=soffice.exe) one for “LibreOffice Calc” (=scalc.exe)
For bonus points I think it is worth removing the Calc icon without the blue background from the file association list. I think that needs a registry edit.
As it was added after using Scalc.exe once via open-with (without registration of default), it may re-appear after deletion, just by using it again. But test, if you like…