Help protecting spreadsheet with password from code

L

lanem

I'm trying to protect spreadsheet from code. I can get it to protect, but I
can't get it to protect with a password. Here's my code:

Dim xl As New Spreadsheet
xl.ActiveSheet.Protect("testpassword")

Thanks for your help.
 
L

lanem

This is the error I get:

System.Runtime.InteropServices.COMException: Exception from HRESULT:
0xE0040059
 
K

Karl E. Peterson

lanem said:
This is the error I get:

System.Runtime.InteropServices.COMException: Exception from HRESULT:
0xE0040059

That's definitely not VBA...
 

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