Run-time error '1004' Method 'Save' of object '_Workbook' failed

G

Guest

Hi,

I have a code as shown below

Private Sub Workbook_Open()
With ThisWorkbook
.Worksheets("HS OVERVIEW").Activate
.Unprotect ("pas")
.Worksheets("LookUpValues").Visible = xlSheetVeryHidden
.Protect "pas", Structure:=True, Windows:=False
.Save
End With
End Sub

When I open my appliacation in excel it throws me error

Run-time error '1004'
Method 'Save' of object '_Workbook' failed

Can't figure out why this is happening.
Help is appreciated.

Thanks,
Neelam
 
F

Frank Kabel

Hi
tested your code and it works without a problem for me. Some ideas:
- is your file saved as read only
- shared workbook
 

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