views:

132

answers:

0

Hi:

I have developed a SharePoint WebPart using ASP.NET and C# (code behind).

One of the things that needs to be done is to launch the Excel Save As dialog so that the user can save the Excel file.

On the SharePoint Server box, this functionality works correctly. When I click "Export", as expected the Excel "Save As" dialog appears.

However, from a client machine (such as mine), this functionality does not work correctly. When I click "Export", the Excel "Save As" dialog box does NOT appear.

Code snippet where this dialog is being launched…

        xlApp.DisplayAlerts = false;

        //xlWorkBook.Save();  

        Microsoft.Office.Interop.Excel.Dialog dialog = xlApp.Dialogs[Microsoft.Office.Interop.Excel.XlBuiltInDialog.xlDialogSaveAs];
        dialog.Show(Type.Missing, // document_text
        Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookDefault, // type_num
        Type.Missing, // prot_pwd
        Type.Missing, // backup
        Type.Missing, // write_res_pwd
        Type.Missing, // read_only_rec
        Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);

        xlApp.DisplayAlerts = true;

Do you know what could be causing this difference? Are there some particular things I should investigate?

Thanks for your help, -Krishna