OWC 11.0 in ASP.NET and C# to create excel file

I'm using OWC 11.0 in ASP.NET and C# to create excel file.

I need to protect/unprotect the sheet by a password.  I tried to protect the 
sheet by following code. 

 


string Password = "Password123";
object getPasswordFromUser =(object)Password;
xl.ActiveSheet.Protect(ref getPasswordFromUser, ref obj,
ref obj, ref obj, ref obj, ref obj, ref obj, ref obj, ref obj, ref obj,
ref obj, ref obj, ref obj, ref obj, ref objTrue, ref obj);But it throws an 
exception "Exception from HRESULT: 0xE0040059"

Kindly help me to resolve this issue. Code works well if I miss the password.

0
Utf
1/26/2010 4:10:01 PM
excel 39879 articles. 2 followers. Follow

0 Replies
1431 Views

Similar Articles

[PageSpeed] 25

Reply:

Similar Artilces:

How to get information from the process monitor queue in GP 9.0
Hi, How to know which process exists in process monitor queue? If developer wants to know process details from process monitor queue in GP 9.0 then is there any system functions available? Constants, which are available in GP7.0 and GP 7.5 does not exists in GP 9.0. Is there any alternative option available in GP 9.0 to retrieve process queue information? Thanks ...

1.2 danish -> 3.0 english
Is this possible ? Jack ...

MS CRM 3.0 and Exchange Server 2000
I have a query regarding installation of CRM E-mail Router. I have a MS CRM 3.0 installed on a Windows 2003 Server, we're using a Exchange Server 2000 on W2K Server SP4, can I install the Router on the Exchange Server 2000? check the implementaiton guide, it gives you system requirements "John Ding" wrote: > I have a query regarding installation of CRM E-mail Router. I have a MS CRM > 3.0 installed on a Windows 2003 Server, we're using a Exchange Server 2000 on > W2K Server SP4, can I install the Router on the Exchange Server 2000? > > > I have...

Excel 07 selects 3 cells when I click on 1
Hi I just got 2007 (I want 2000 back) and a lot of the time when click on an empty cell 2 or more below it are selected and the typing goes on the bottom row. I just want to select the cell I click on. Thanks Are the cells merged?? I don't like the 2007 either! If i could i would have the look and feel of 2003 on the engine of 2007... :-( On Thu, 1 Nov 2007 20:21:01 -0700, Brian <Brian@discussions.microsoft.com> wrote: >Hi I just got 2007 (I want 2000 back) and a lot of the time when click on an >empty cell 2 or more below it are selected and the typing goes on the botto...

Excel 2003/edit/replace. Under Options/Look In, values is AWOL bu.
Under Look In options Find allows for search by formulae OR values OR comments Replace is restricted to formulaes ONLY WHY? cp Have a look at this google search result. This topic came up a couple days ago and was addressed by Dave and Myrna. http://snipurl.com/cd9j Gord Dibben Excel MVP On Fri, 28 Jan 2005 03:49:02 -0800, "cp" <cp@discussions.microsoft.com> wrote: >Under Look In options >Find allows for search by formulae OR values OR comments >Replace is restricted to formulaes ONLY >WHY? ...

how do i enable dde in excel?
i am posting a DDE link into an excel cell from an external program and getting the message ' DDE Not enabled' in the cell once the link is pasted in. how do i enable DDE? ...

Can anyone send me the Microsoft.Crm.Platform.Proxy.dll and Microsoft.Crm.Platform.Types.dll files ?
Hi, I'm stucked without those files, and I don't have the instalation disk. Can anyone send me those files ? Thanks in advance, Eddie. You can download the program from Microsoft. http://www.microsoft.com/office/onenote/prodinfo/trial.mspx#EEAA Sorry-wrong group Eddie, email me and i will send them over -- John O'Donnell Microsoft CRM MVP http://www.mscrmfaq.us "Eddie" <Eddie@discussions.microsoft.com> wrote in message news:epJ2yF3NFHA.3076@tk2msftngp13.phx.gbl... > Hi, > > I'm stucked without those files...

Relationships 11-12-09
Hi, I was hoping someone could explain to me in "layman" terms about relationships. I have done 3 course using access and have even had a consultant come out and spend the day with me. my problem is i cannot figure out how to make my tables work. I have 25 tables that have nothing in common with each other. for example, one is for steel parts, another one for valve's, consumables etc they have nothing in common but at the end they give me a price for a job installation. How do i make the relationships work with each one? Should i be putting like an ID number ...

excel file can't be opened #2
hi,I'm cho I have a recent excel file (about 1 month),but since two days ago,the file can't be opened completely or always not responding. What should I do so that I can use this important file. Any help would be appreciated regards, cho ...

How to transpose in excel file
Hi I would like to make a transpose like this? From House Defect How much #1 Broken Sinks 1000 #1 Bad Paint 2000 #1 Bad Lighting 1000 #2 Broken Sinks 0 #2 Bad Paint 2000 #2 Bad Lighting 100 and Transpose into House Broken Sinks Bad Paint Bad Lighting #1 1000 2000 1000 #2 0 2000 100 A Pivot Table will do that and more. Set House as row field, Defect as column field and How much as data. HTH. Best wishes Harald "vilfood" <vilfood@d...

MBF file won't open...am I hosed???
In my previous computer I had a flaky hard drive. While it still worked I backed up all my important files to CD's and DVD's. Since I dutifully backed up my MNY file (to two locations) each time I used my Money 2001 I didn't think to copy my MNY file I merely copied the MBF files from those locations. Once, I had to use that an MBF file as my MNY file was corrupt and it worked flawlessly. I saw no reason why it shouldn't do so again. Plus I was in panic mode to get all the data possible from the dying HD. Now that I have a new computer I installed my copy of MM 2001 and wh...

Outlook 2003 attach File Browse Window Stops Responding
In outlook 2003 when I try to attach a file and the browse window pops open to browse for the file I want to attach the window will stop responding and I have to force quit the outlook. Any Ideas? do you have mapped network drives? how long do you wait before quitting outlook? -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Author, Google and Other Search Engines (Visual QuickStart Guide) Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipsti...

Bulk Import Wizard for Leads Issue
Hi, I am trying to import Lead records using a CSV file containing around 3,000 records. I have tested with around 20 records (taken from the larger file) and it imports fine but when I select the the 3,000 record file for import the wizard gives an error message somthing like (sorry don't have exact wording) 'Source Import file is corrupt'. Are there any known issues with CSV files such as the following : 1) Special characters such as an asterix not handled 2) Email and Website type fields must all be correctly formatted? 3) File is too large Thanks for your help in adva...

Can't restor backup file, "Please insert the next backup disk.....
I have money 2005 backup file (.mbf) and my original file has gotten corrupted somehow and can't repair it (computer hung and had to be restarted). Whenever I try to restor the backup file, I get the following message, Window Title: Money Multiple Disk Backup Message: Please insert the next backup disk. (The disk containing file "".) I was backing up on a different connected single harddrive and there is only one file. The file is not in multiple pieces and on different drives. When I click OK, it doesn't do anything and cancel just stops the process. I even down...

Headers in Excel #3
Can you tell me if it's possible and if so, how I can change the header cells, i.e. A B C D E ... etc? Thanks. Andrea (508) 842-3880 Hi Andrea no this is not possible. The best workaround you can achieve is: - use row 1 as header - goto cell A2 and to the menu 'Windows - Freeze Panes' to always show row 1 - in 'Tools - Options - view' you can hide the row and column headers -- Regards Frank Kabel Frankfurt, Germany "Andrea" <shrews.receptionist@nitco-lift.com> schrieb im Newsbeitrag news:12ff301c44354$b88982b0$a501280a@phx.gbl... > Can you tell ...

Excel -> Access Import Bizarreness
A guy gave me an Excel file that he needs me to covert to XML. No problem. Slurp it into a database and use a DataSet.WriteXML() call to turn it into an XML file. But I can't import it into Access because it has "Merged Cells". For example, data that should look like this: ColA ColB ----- ----- Rec1 this Rec2 this Rec3 this Rec4 that Rec5 Other The three "this" cells have been merged into one tall cell: ColA ColB ----- ----- Rec1 this Rec2 Rec3 Rec4 that Rec5 Other I need to "unmerge" these, but I know almost nothi...

Problems creating a newsletter
I chose the form "Newsletter - email". I have created a 3 page newsletter. Now, I have NO IDEA how to send it out as an email. I do not want to send it as an attachment. I cannot figure out which "save as" format or what I need to do so that i can email this newsletter. Is there a website that goes through how to do this? Am I correct when I say that it has to be html in order for me to send it as email? That is not one of the options. Any help you give me would be greatly appreciated. I am using 2003 Publisher. I created the book "Tri-Puzzles for Genesis - I"...

Is this possible within Excel 2000?
Hi, I've used Excel on a get by basis for many years at work, and I'm just beginning to realise its vast capabilities, having viewed several groups which I didn't know existed previously. I subsequently would like to ask if it is possible for Excel to look at the numerical or text content of a cell on one worksheet and then look at a predefined range on another worksheet and find the equivalent cell content and then move the cursor to that cell? This has me stumped presently. Thanks in advance for any assistance. J.J. To actually move the selection, you'd need to use a litt...

Excel 2000 fail to open workbook
Hi, I have one Excel template. If we open it on Excel 2000, the Excel will hang, and the process occupy cpu 95% ~98%. But we can open this tempalte in Excel 2003 normally, and if we save this tempalte in Excel 2003, and then open it in Excel 2000, it work normally too. Excel 2000 (9.0.3821 SR-1) Excel 2003 (11.8231.8221) sp3 Would you help us to find the reason for this issue? Thanks, Nancy Hi Nancy, Perhaps there was some (probably minor) corruption/inconsistency in the workbook that Excel 2003 could fix but Excel 2000 couldn't. -- Cheers macropod [Microsoft MVP - Word] ...

How can I create an invoicing database in Excel?
I would like to know how to create an invoicing database, or register in Excel. (Invoice + tax = total) Are there any templates free online? thanks How about a web search? http://office.microsoft.com/en-us/templates/default.aspx search for invoice -- Regards, Peo Sjoblom (No private emails please, for everyone's benefit keep the discussion in the newsgroup/forum) "Vcollins" <Vcollins@discussions.microsoft.com> wrote in message news:C46E9FE2-0B38-4468-9B00-126B7EE5C9A2@microsoft.com... >I would like to know how to create an invoicing database, or register in &...

Error by open contacts or activities after Migration to CRM 3.0
Hello, i ve migrated our CRM 1.2 System to CRM 3.0 Now I get a error-page when I open contacts or activities or so. I cannot open the main form of these entities (customizing). Any ideas? Stefan ...

How do you check out a file from a link
I have received a link to an excel file stored in a SharePoint library. When I open the file the option to 'check out the file' does not appear at the top of my screen. This function does work for a word document in the same library. Please can you advise. Thanks With your browser, go to the Library where the document is located and check out from there. --rms www.rmschneider.com On 16/04/10 15:44, Tracey T wrote: > I have received a link to an excel file stored in a SharePoint library. When > I open the file the option to 'check out the fi...

XSD
Hi all, I defined a XML Schema... so I've a .xsd file. I defined the schema using "default" attribute... for example: <xs:element name="color" type="xs:string" default="red"/> Now, I would like to generate an empty XML file, from the XML Schema. How can I do that? Thanks a lot. Bye -- Stefano Giannone MCP .NET http://www.giasoft.it Stefano wrote: > I defined a XML Schema... so I've a .xsd file. > > I defined the schema using "default" attribute... for example: > <xs:element name="color" typ...

Excel prints some sheets very small
When I try to print multiple sheets of the same workbook at the same time, one of them (a different one each time) prints very small (about an inch tall) in the upper left hand corner. I am printing from a network file but I don't know if this has anything to do with it or not. Please HELP!!! ...

EXCEL 2007 acting up
j$ = "THIS MACRO WILL ERASE THE SECOND & THIRD SET OF DATA" + Chr$(13) + Chr$(13) Using EXCEL 2007, I get an error with the line above as a macro. It does not recognize CHR$. What am I doing wrong? Thanks Not for me it didn't. Check for MISSING references in Tools>References, uncheck them if there are any. -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "pcor" <pcor@discussions.microsoft.com> wrote in message news:F63F6E95-AF0A-4927-B337-99B5C48B92B1@microsoft.com... > j$ = "THIS MACRO WILL...