Export to Excel - Excel Not Opening

J

JP

Hello, I am using Microsoft.Office.Interop.Excel to export numerous gridview
data to Excel. The ASP.NET app is working fine on my laptop but when I
publish the code to our dev server it doesn't work. I get no error messages
to help me out with diagnosing.

When I click the link to do the export, the page refreshes and nothing
happens. Does anyone have a clue why it wouldn't work on dev?

Below is the code snippet:


try

{

string path = Server.MapPath("Test.xls");

ApplicationClass app = new ApplicationClass();

Workbook book = null;

book = app.Workbooks.Open(path, Missing.Value, false, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
true, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value);

GetGridData()



app.Visible = true;
app.UserControl = true;

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top