ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Allow custom update button to work while sheet is protected (https://www.excelbanter.com/excel-discussion-misc-queries/99197-allow-custom-update-button-work-while-sheet-protected.html)

mhng

Allow custom update button to work while sheet is protected
 
I have two sections on my sheet. One being a query and the next section for
users to input data. The query is protected and the later can be edited.
However, I would like to allow users to click on an update button which I
have programmed to update the queries from database. When the sheet is
protected, users failed to click on the button eventhough I have uncheck the
lock property.

This is the code for the update button:
Private Sub cmdButton_RefreshMDBF_Click()

Range("MDBF_Query").QueryTable.Refresh BackgroundQuery:=False
Range("Plan_MDBF_Query").QueryTable.Refresh BackgroundQuery:=False
Range("MDBF_Plan").Calculate

End Sub


All times are GMT +1. The time now is 02:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com