tags:

views:

49

answers:

1

open Excel sheet with full privileged in c#. it is not allowing me to read. asking for uname and pwd when i deploye my c# application in iis.

i have write this code for open Excel : please review

Excel.ApplicationClass app = new Excel.ApplicationClass(); Excel.Workbook workbook = app.Workbooks.Open( strSheetPath, 0, true, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0 );

        Excel.Worksheet worksheet = (Excel.Worksheet)workbook.ActiveSheet;
        Excel.Range rng = null;
        Excel.CellFormat format;

        rng = worksheet.get_Range("A2", Missing.Value);
        rng = rng.get_End(Excel.XlDirection.xlToRight);
        rng = rng.get_End(Excel.XlDirection.xlDown);
A: 

Dose the file need pwd?

Begtostudy