UserInterface problem

Giordano Bruno

Well-known Member
Joined
Jan 7, 2007
Messages
1,231
I have this code in the ThisWorkbook section.

Private Sub Workbook_Open()
ThisWorkbook.Sheets("Futures1").Protect UserInterfaceOnly:=vbTrue

I close the workbook and open it again.

When I try to run a macro which moves some lines in the Futures1 worksheet, I get the following message:

"You cannot use this command on a protected sheet.To unprotect the sheet, use the unprotect sheet command(Tools menu, protection sub menu).You may be prompted for a password".

Can anyone see what I am doing wrong?
PPS I am not using any passwords.

PS I'm using Excel2000
 

Some videos you may like

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
I can't reproduce that behaviour in Excel 2003 with this code:

Code:
'ThisWorkbook module
Private Sub Workbook_Open()
    ThisWorkbook.Sheets("Futures1").Protect UserInterfaceOnly:=vbTrue
End Sub

'General module
Sub Test()
    Worksheets("Futures1").Rows(1).Delete
End Sub

What code do you have?
 

Giordano Bruno

Well-known Member
Joined
Jan 7, 2007
Messages
1,231
Hello Andrew.

Thanks for your interest. I have just done an experiment and find that for some reason, the Workbook_Open macro is not running. I put a select cell instruction in as well and it was ignored. Strangely, my other macros do run so they are certainly enabled. I didn't type the Workbook open line, but got it from the menu.

It seems to be perhaps a problem with the sheet or the computer.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,469
Messages
5,596,316
Members
414,053
Latest member
Dual Showman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top