Imposing rights to excel add-in

Joined
Nov 15, 2007
Messages
1
Reaction score
0
hi all
i hope i am posting this at the right place; i have a small prototype that opens an existing xla file and then checks to see if it is protected with rights. The code is written in c# :
Console.WriteLine("Hello Excel");

Microsoft.Office.Interop.Excel.ApplicationClass excelApp = new Microsoft.Office.Interop.Excel.ApplicationClass();
excelApp.Visible = false;
Microsoft.Office.Interop.Excel.Workbook wb = null;
try
{
wb = excelApp.Workbooks.Open(eFileName, 0, false, 5, "", "", false, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows,"",false, false, 0, true, false, false);
}
catch (Exception comException)
{
Console.WriteLine("exception while opening file : " + comException.Message);
wb.Application.Quit();
}
wb.Activate();
try
{

if (!wb.Permission.Enabled)//this is causing problem)


at this point an exception is thrown which is:
Server threw an Exception HRESULT: 0x80010105

I have tried searching and found lots of entries but none of them worked out for me, if anyone has any idea how to go about it please do reply.
thanks in advance.
 

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