tags:

views:

141

answers:

2

Hi all,

I've been creating my FIRST website (XHTML) - means I don't know a lot (please explain evrything very detailed ;o)

I need to show a value from an excel sheet on my website. The excelsheet "Country" is on C: and I need to show the text from cell C2.

Can someone help me?

A: 

Just a couple of recommendations, I don't have code for you, but perhaps this might point you in a good direction.

If you can get away with saving the Excel spreadsheet in an XML format then just open it as an XML doc and query for the value. However, I suspect that you may not have that as an option.

.NET has some Office assemblies to open, manipulate, read MS Office documents, but you may have difficulty getting that to run well on a server environment.

If it is an Office 2007 document, there is an OpenXML SDK that can be used to work with Excel documents.

Finally, rather reliable method (not necessarily the most efficient) for getting data from an Excel spreadsheet is to use an OleDbConnection, OleDbDataAdaptor and query it.

James Conigliaro
OK, thanks, I'll have a look.
+1  A: 

In Perl you can use the Spreadsheet::ParseExcel module to read Excel files. Python and Ruby have similar modules.

use warnings;
use strict;
use Spreadsheet::ParseExcel;

my ($parser, $workbook, $worksheet, $cell);

$parser    = Spreadsheet::ParseExcel->new();
$workbook  = $parser->Parse('test_file.xls');
$worksheet = $workbook->Worksheet('Country');
$cell      = $worksheet->get_cell(1, 2);  # Cell C2

print "Value = ", $cell->value(), "\n";
FM