Zud
Zud

Reputation: 4497

C++ Outputting to an Excel file

Is there a way to output to an excel file but to assign what you're outputting to a specific cell in the excel file?

For example have an array be cell x 1-50 or something like this.

Upvotes: 0

Views: 5133

Answers (3)

Loki Astari
Loki Astari

Reputation: 264739

You can output data in as CSV and excel will read it just fine:

row 1 cell 1, row 1 cell 2
row 2 cell 1, row 2 cell 2

Upvotes: 0

Tronic
Tronic

Reputation: 191

There are some C++ libraries for that. An example of a free one is xlsstream and a commercial one would be LibXL. Google is your friend to find more.

Upvotes: 3

tibur
tibur

Reputation: 11636

You can output an html formatted table to a file with an xls extension. When loading it, Excel will convert it to a spreadsheet. Sample:

<table border="1">
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</table>

Upvotes: 0

Related Questions