Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open existing excel spreadsheet in browser

Status
Not open for further replies.

mmarino

Programmer
Mar 22, 2002
42
0
0
US
I have an excel spreadsheet that lives on the server, I'm trying to get it to open on my browser window.
This is my code (openxl.cgi):

$excel="\/usr\/common\/reportdir\/excelsample.xls";
print "content-type: application/vnd.ms-excel\n";
print "content-disposition: inline\n\n";
print $excel;

The browser opens excel, but I don't get my data, instead all I see is the name of my data file (the /usr/common/...xls) in the first cell.
What am I doing wrong?
Thanks for any help :)
 
You need to print the contents of the file, and not the file name.
 
You mean, read the file line by line and print each line?
Hadn't even thought about that...
Thanks, I'll try it.
 
Ok, I can open a plain excel file now, thanks!
Now my problem is that my excel file has a macro in it. Basically the macro opens a txt file and formats the text to make it look good. So far I can't get the file to open.
I think it can't find the txt file. Is there anything special I need to do?
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top