Unprotect Excel Worksheet From VB 2008

  • Thread starter Thread starter Octavius Khan
  • Start date Start date
O

Octavius Khan

I am using VS2008 and am creating an Exel 2003 project. The existing file
that I am using has protected worksheets, but I cannot get it to compile.

When I use the following code, I an error message that the sheet is protect
even though I've entered the correct password.

Private Sub Sheet1_Startup(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Startup

Unprotect("test")

End Sub

If I use Unprotect(), it compiles, but the sheet remains protected.

The help system doesn't show how I can enter a password. Can someone point
me into the direction of examples to properly use this?

Thanks.
 
The help system doesn't show how I can enter a password. Can someone point
me into the direction of examples to properly use this?

Google?

I have seen a lot of code for unprotecting excel workbooks, and I'm
fairly sure the code is still floating out there.

Thanks,

Seth Rowe [MVP]
 
Thanks, Seth.

I'll keep searching. I've seen a lot of code also, but most of it was
specific to VBA where the unprotect actually works. However, I have found
that there is some code that does well in VBA does not in VB.net. I am
really not sure why. The problem I'm really having with this one is that
there isn't a clear example on using this within an Excel 2003 VB.Net
Project.
 
Back
Top