Problem with Workbook.Open() event of Microsoft.Office.Interop.Excel ‘12’ library

Joined
Jan 17, 2008
Messages
1
Reaction score
0
Problem with Workbooks.Open() event of Microsoft.Office.Interop.Excel ‘12’ library

Hi...


I have succeeded using Documents.Open() event of “Microsoft.Office.Interop.Word” dll (Office ‘12’ library) to open a .DOCX open-password-protected file. It creates a Word.Document object successfully.


But when I am trying with Workbook.Open() event of “Microsoft.Office.Interop.Excel” dll (Office ‘12’ library) to open a .XLSX open-password-protected file, it is opening an Excel application prompting for the password, though I have have provided the password in the parameter. I am calling this function as follows:



_book = _excelApp.Workbooks.Open(@"C:\open.xlsx", //FileName

2, //UpdateLinks

true, //ReadOnly

Type.Missing, //Format

“open” //Password Type.Missing, //WriteResPassword

ignoreReadOnly, //IgnoreReadOnlyRecommended

Type.Missing, //Origin

Type.Missing, //Delimiter

Type.Missing, //Editable

false, //Notify

Type.Missing, //Converter

Type.Missing, //AddToMru

Type.Missing, //Local

Type.Missing); //CorruptLoad



Note:

I am trying these things on the machine having only Office 2003 installed, along with the Office ‘12’, Word ‘12’, and Excel ‘12’ libraries copied there.

I am using VS2005(C#) and .Net Framework 2.0 for this implementation.



Can anybody tell me how to get rid of this problem?



I would really appreciate if somebody can help me out.
 
Last edited:

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