古い .xls ファイルのとき
この記事のポイント
- 開く
- 保存し直す
古い形式の .xls ファイルを、HTMLやMarkdownの表にしたい。Excelの表をHTML・Markdownにする は、.xlsx 形式のファイルを対象にしています。.xls のままでは、使えない場合があります。
対応している形式
- 対応:.xlsx
- 対応していない:.xls(古い形式)
.xls を .xlsx にする方法
- .xls ファイルを、Excelで開く。
- 「名前を付けて保存」を選ぶ。
- ファイルの種類を、「Excelブック(.xlsx)」にして保存する。
- 保存した .xlsx を、このツールで開く。
拡張子だけを書き換えても、使えません。必ず、Excelで保存し直します。
保存し直すときの注意
- 元の .xls ファイルは、そのまま残しておく
- マクロは、.xlsx には保存されない
- 保存後に、表の内容が正しいか確かめる
他の方法
- 表を選んでコピーし、直接Webページやドキュメントに貼り付ける方法もある(ただし、書式が混ざることがある)
- CSVで保存して、CSVからの変換ツールを使う方法もある
他の形式のとき
- .xlsm(マクロ付き):.xlsx で保存し直してから使う。
- Googleスプレッドシート:Excel形式でダウンロードしてから使う。
向いている場面
- 昔の資料の表を、Webに載せたい
- 古いシステムの出力を、ドキュメントにしたい
例
5年前の.xlsの料金表を、サイトに載せたかった。Excelで.xlsxに保存し直し、このツールでHTMLの表にして、貼り付けた。
つまずきやすい点
- 「読み取れません」と出る:.xls や、壊れたファイルの可能性。
- 文字化けする:保存し直すと直ることがある。
よくある質問
拡張子を .xlsx に書き換えれば、使えますか?
いいえ。中身の形式が違うため、使えません。
まとめ
.xls は、Excelで .xlsx に保存し直してから。
Excelの表をHTML・Markdownにするを使う(無料)あわせて使えるツール
- ExcelをCSV・JSONに変換する:Excelのシートを、CSV・TSV・JSONに変換します。
- WordをHTMLに変換する:Wordの文章を、Webに貼れるHTMLにします。
- CSVとJSONを相互変換する:CSVとJSONを、すぐに相互変換します。
同じツールの、ほかの解説
When the File Is an Old .xls
Key points
- Open
- Re-save
You want to turn an old-format .xls file into an HTML or Markdown table. Convert an Excel Table to HTML or Markdown targets .xlsx files. A .xls file as it is may not be usable.
Supported formats
- Supported: .xlsx
- Not supported: .xls (old format)
How to turn .xls into .xlsx
- Open the .xls file in Excel.
- Choose "Save As".
- Set the file type to "Excel Workbook (.xlsx)" and save.
- Open the saved .xlsx in this tool.
Changing only the extension doesn't work. Always re-save in Excel.
Notes when re-saving
- Keep the original .xls file as it is
- Macros aren't stored in .xlsx
- After saving, check that the table content is correct
Other methods
- You can also select the table, copy it and paste directly into a web page or document (though formatting can get mixed in)
- You can also save as CSV and use a conversion tool from CSV
For other formats
- .xlsm (with macros): re-save as .xlsx, then use.
- Google Sheets: download in Excel format, then use.
Good for
- Putting tables from old material on the web
- Turning old system output into documentation
Example
Wanted to put a 5-year-old .xls price list on the site. Re-saved as .xlsx in Excel, turned it into an HTML table with this tool and pasted it.
Common stumbling blocks
- "Cannot read" appears: may be .xls or a broken file.
- Garbled text: re-saving sometimes fixes it.
Frequently asked questions
Can I just rename the extension to .xlsx?
No. The internal format differs, so it won't work.
Summary
For .xls, re-save as .xlsx in Excel first.
Use "Convert an Excel Table to HTML or Markdown" (free)Tools that go well with this
- Convert Excel to CSV or JSON: Convert an Excel sheet to CSV, TSV or JSON.
- Convert Word to HTML: Turn Word text into HTML.
- Convert CSV and JSON: Convert between CSV and JSON instantly.