• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Run macros in a protected workbook/worksheet

ydmani

New Member
Hi all,

As the subject suggest, I created a database table and some pivot tables dependent on the database table. I also created a macro on the main sheet just to refresh all the pivot tables with one click and some other for my pivot tables, but as soon as I protect the sheets containing pivot tables, all macros stopped working and returns a "Run-time error '1004'.

I just wanted to know, is there any way out to above problem. Can I create a macros enabled protected sheet.

Thanks in advance
 
You need to do like as below!

Code:
Sheet1.Unprotect "mypassword"

....codes to run....

Sheet1.Protect "mypassword"
 
plz help ...


Sub cccc()

Sheetdashboard.Unprotect "PW"

Dim lngLoop As Long
Dim lngDelay As Long
'
With ActiveSheet.ChartObjects("Chart 20").Chart
For lngLoop = 1 To 360
.Rotation = lngLoop
DoEvents
For lngDelay = 1 To 10000
'CRUDE DELAY
Next
Next
End With

Sheetdashboard.Protect "PW"

End Sub
 
Back
Top