{"id":7811,"date":"2021-05-23T22:19:26","date_gmt":"2021-05-23T22:19:26","guid":{"rendered":"https:\/\/www.hexacorn.com\/blog\/?p=7811"},"modified":"2021-05-23T22:21:19","modified_gmt":"2021-05-23T22:21:19","slug":"excellent-conversions-and-downloads","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2021\/05\/23\/excellent-conversions-and-downloads\/","title":{"rendered":"Excellent Conversions (and downloads)"},"content":{"rendered":"\n<p>This one was on a back burner for a while too. <\/p>\n\n\n\n<p><em>C:\\Program Files*\\Microsoft Office\\root\\Office*\\excelcnv.exe<\/em> is a program that helps to convert various documents  to XLSX format. While <a href=\"https:\/\/twitter.com\/Hexacorn\/status\/1396536863498907654\">playing around<\/a> with it I noticed it accepts URLs hence you can use it to download stuff from the internet. The caveat is that this downloaded data will be stored inside a UTF8-encoded stream embedded inside the XLSX Zip archive. <\/p>\n\n\n\n<p>Example binary data (favicon.ico):<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2021\/05\/excelcnv_1.png\"><img decoding=\"async\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2021\/05\/excelcnv_1.png\" alt=\"\" class=\"wp-image-7812\" width=\"500\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2021\/05\/excelcnv_1.png 652w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2021\/05\/excelcnv_1-300x82.png 300w\" sizes=\"(max-width: 652px) 100vw, 652px\" \/><\/a><\/figure><\/div>\n\n\n\n<p>and data downloaded as a stream:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2021\/05\/excelcnv_2.png\"><img decoding=\"async\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2021\/05\/excelcnv_2.png\" alt=\"\" class=\"wp-image-7813\" width=\"500\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2021\/05\/excelcnv_2.png 662w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2021\/05\/excelcnv_2-300x104.png 300w\" sizes=\"(max-width: 662px) 100vw, 662px\" \/><\/a><\/figure><\/div>\n\n\n\n<p>The command line arguments for <em>excelcnv.exe<\/em> are not documented well. Many examples online refer to &#8220;-oice&#8221; argument followed by the input and output file names. That&#8217;s it. And yeah, this actually works, so since I have already mentioned that input parameter can be an URL, the downloader invocation can be as follows:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">excelcnv.exe -oice &lt;URL&gt; &lt;OUPUT&gt;<\/pre>\n\n\n\n<p>Still, there is more to discover. <\/p>\n\n\n\n<p>For instance, what the heck is &#8216;oice&#8217;? After googling around I eventually discovered it stands for <a href=\"https:\/\/docs.microsoft.com\/en-us\/security-updates\/securitybulletins\/2011\/ms11-036\">Office Isolated Conversion Environment<\/a>. <\/p>\n\n\n\n<p>Other interesting stuff to look at are other, undocumented command line arguments used by <em>excelcnv.exe<\/em> &#8211; these I found so far are as follows:<\/p>\n\n\n\n<ul><li>-oics &#8211; don&#8217;t know how it is being used at the moment<\/li><li>-bcs &#8211; you can use it to convert INPUT file to .ods e.g. <ul><li><em>excelcnv.exe -bcs &lt;XLSX&gt; &lt;ODS&gt;<\/em><\/li><\/ul><\/li><li>-repair<\/li><li>-o &#8211; orientation (for PDF)<\/li><li>-ps &#8211; paper size (for PDF)<\/li><li>-dps &#8211; default paper size (for PDF)<\/li><li>-scl &#8211; scaling option (for PDF)<\/li><li>-wtp &#8211; what to print (for PDF)<\/li><li>-preview &#8211; preview quality (for PDF)<\/li><li>-pofo &#8211; automatic print on file open (for PDF)<\/li><li>-nafap &#8211; use named action setting (for PDF)<\/li><li>-pglim &#8211; page limit (for PDF)<\/li><li>-rv &#8211; unknown (for PDF)<\/li><\/ul>\n\n\n\n<p>There are probably more, but this is what I explored so far.<\/p>\n\n\n\n<p>The default OUTPUT file type is XLSX. The file format can be changed using a dedicated file extension accepted by the program:<\/p>\n\n\n\n<ul><li>.xltx<\/li><li>.xlam<\/li><li>.xlsm<\/li><li>.ods<\/li><li>.xls*<\/li><li>.pdf<\/li><li>.xlsx<\/li><li>.png<\/li><li>.jpg<\/li><\/ul>\n\n\n\n<p>but not sure yet how to use all of them as not all of them worked for me (good news is that all the *.xl* work well with &#8220;-oice&#8221; command). <\/p>\n","protected":false},"excerpt":{"rendered":"<p>This one was on a back burner for a while too. C:\\Program Files*\\Microsoft Office\\root\\Office*\\excelcnv.exe is a program that helps to convert various documents to XLSX format. While playing around with it I noticed it accepts URLs hence you can use &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2021\/05\/23\/excellent-conversions-and-downloads\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[53,56,64],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/7811"}],"collection":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/comments?post=7811"}],"version-history":[{"count":3,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/7811\/revisions"}],"predecessor-version":[{"id":7816,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/7811\/revisions\/7816"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=7811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=7811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=7811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}