UserInterface problem

Giordano Bruno

Well-known Member
Joined
Jan 7, 2007
Messages
1,341
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
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
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?
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,213,510
Messages
6,114,037
Members
448,543
Latest member
MartinLarkin

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
Back
Top