View Full Version : Embed Excel in web page

02-21-2012, 08:10 PM
Hello all. I have a web page and am wanting to embed an excel document into a page so that users can log in and fill out the document (a time sheet) and then have a submit or email button or something similar to save the document on my server with a custom name according to their username or send an email with the document attached.

Any help would be greatly appreciated.


02-21-2012, 09:51 PM
Whatever they do, save it as a CSV (comma separated variable) file. .csv
Those will automatically open with Excel even if you open it from the website itself.

The only thing you lose is RTF rich text formatting. But I would guess it's the
values that you're interested in, not the Excel sheet layout itself. To me, the .csv
would be the easiest way. You can also combine them all into one .csv before
you open it if you want.

Run this little PHP script test. Save this script as "test.php" run it,
and then try to open the "test.csv" file using your browser.

Smith, John, 12345, xxx,
Johnson, Richard, 3243, xxx,
Anderson, Jane, 5674, xxx,
$fw = fopen($file, 'w') or die("can't open file");
fwrite($fw, $text);

echo"<br /><br />
<a href='test.csv'>Open me</a>

Make sure the directory you upload in has permission to write to a file.


02-22-2012, 06:55 AM
You need Office for the Web components to have Excel interactivity on the internet which are not typically available on shared hosting accounts.

02-22-2012, 03:23 PM
But I think it's a one-way street.
Excel only needs to be able to FTP a .csv or .xml file to a website directory.
There are no other exchanges of data.

So, it's just a file transfer only.

Either Excel does it, or you save the Excel file as a .csv file and upload it using FTP or PHP.
With limited computer knowledge, the user might not know how to "save-as" and upload the file.
That's why I'm pushing toward the automatic FTP idea.