Excel online

I am looking for a solution that will allow us to put excel sheets with macros enabled on the web and am wondeing if this is a valuable solution for this. Basically we have a bunch of premade excel files that have a bunch of macros on them, and we want to be able to supply those via the web where users can do one of two things… Run the excel sheets on the fly or download the files…


If you just want to allow your users to download the files, it's very easy. You just need to load them into memory and send them to client browser.

Do you want to populate data into your excel files at run time? What do you mean "Run the excel sheets on the fly"? Could you elaborate your need so I can understand them more clearly?

What I mean by run on the fly is that we have these excel sheets with macros on them that are linked to buttons on the excel sheet on the web… I want the user to be able to execute the macro on the excel sheet on the web. For example we may have a button called “Hide Address” that if you click it on the excel sheet I would execute a macro that would hide the address column on the excel sheet. let me know if this helps if not I will try again…

To stream a file with macros to client browser, you can use the following code:

FileStream fs1 = new FileStream("d:\\book1.xls", FileMode.Open, FileAccess.Read);
byte[] data1 = new byte[fs1.Length];
fs1.Read(data1, 0, data1.Length);


this.Response.ContentType = "application/xls";
Response.AddHeader( "content-disposition","inline; filename=book1.xls");
Response.BinaryWrite(data1);
Response.End();

Can this serve your need?

I tried the solution out on a file with macros and am having similar issues. The application does open the file but throws errors because of the macros…I will try and gather a sample of what I am talking about. Do you think that I would be possible to have the excel sheet up online in a browser and function like and excel sheet in excel…

When opening in browser, actually the browser calls MS Excel to run it. I don't know what's the problem you met. I tried with a file with macros and don't find any problem.