PDA

Click to See Complete Forum and Search --> : Unprotect Excel Sheet


virux
Jul 31st, 2000, 09:29 PM
Hi!

Any of you knows how to unprotect an excel sheet from VB. That must include typing the password automatically by my VB program. This is the part where I'm currently stuck!

Anybody can help?

Currently my code to unprotec is like that:

Activesheet.Unprotect

But this code will prompt the Enter password dialog box within Excel whereby the user will need to key in the password. What i want now is for VB to key in the password himself. I've tried to use the Macro to record the steps but it just wouldn't record the part where the password is supposed to be typed...

I'll be very happy if someone can help :)

Regards,
virux

gwdash
Aug 5th, 2000, 11:13 PM
i have recently written a monitoring program. It opens a protected spreadsheet. What i do is open it passing the password as an attribute in the open function. If i want to change the password, i use saveas and overwrite the original. Hope this helps