cancel
Showing results for 
Search instead for 
Did you mean: 

How to execute "Lock Cells" button through VBA Macro?

0 Kudos

Dear all,

The requirement is to lock input-ready cells on a Excel button click. We don't want to use the standard "Lock Cells" button provided in Planning Ribbon.

Button functionality is implemented in VBA Macro, But i am not able to find any information on How to trigget the AFO "Lock Cells" there. An option of Excel Locking is possible, but it only works when we protect the whole worksheet and in our case it is useless.

Any ideas?

Thanks & Regards,

vamsi.

Accepted Solutions (0)

Answers (2)

Answers (2)

IgorK
Explorer
0 Kudos

Hi vamsi,

did you find a solution for this problem?

We have the same need in our project.

Best regards,

Igor

former_member210191
Participant
0 Kudos

Hi Igor.

I could not lock the cells using a macro but I reached something useful.

  • By using a macro I changed non-editable cells design, so they looked like "locked" cells. I attached this logic to the refresh workbook event.
  • By using a query inverse formula I rejected all changes done in these cells when transferring values to BW server.

Best regards,

Nacho

Former Member
0 Kudos

The toggle between display and change button will give the functionality you are looking for. You will see the button once you enable the planning ribbon under AFO settings.

0 Kudos

Hi,

I am not trying to lock the whole workbook. I need to be able to lock only one input ready column. You can actually lock each input-ready cell using this "Lock Cells" button.

But the requirement is to use custom button instead of standard ribbon button.

Best Regards,

Vamsi.

0 Kudos

Hi,

the cell locking feature is an aid for manual input, e.g. in the context of inverse formulas and disaggregation. If you just want to make a column not input-ready do this in the query designer or use a data slice.

Regards,

Gregor

former_member210191
Participant
0 Kudos

Hi Vamsi.

Did you find a solution for this. I would like also to call the lock cell button by using a macro.

Thank you.

Best regards,

Nacho