Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Stilla
 
Posts: n/a
Default Does protecting a workbook shut off VBA code?

At this site, you guys helped me out on some code to automatically name tabs
from an entry on the worksheets. Works great, thanks!

When I protect the workbook, however, the code does not work. Did I do
something wrong, or does this normaly happen?

I have to protect the workbook for various reasons. Actually, that is why I
needed the tabs to be named automatically.

Any insights welcome!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David D
 
Posts: n/a
Default Does protecting a workbook shut off VBA code?

When you protect a worksheet/workbook, even VBA becomes limited.

For example, if a sheet is protected and you use VBA to add a row, you'll
get a runtime error.

You need to add code to your VBA routine that will unprotect the sheet, do
its thing, and then protect it again.

Sheets("whateverthename").UnProtect
....
Sheets("whateverthename").Protect

Hope that helps.

--
-David D


"Stilla" wrote:

At this site, you guys helped me out on some code to automatically name tabs
from an entry on the worksheets. Works great, thanks!

When I protect the workbook, however, the code does not work. Did I do
something wrong, or does this normaly happen?

I have to protect the workbook for various reasons. Actually, that is why I
needed the tabs to be named automatically.

Any insights welcome!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to Improve Code Copying/Pasting Between Workbooks David Excel Discussion (Misc queries) 1 January 6th 06 03:56 AM
Change case...help please Terry Excel Worksheet Functions 14 October 2nd 05 12:29 PM
Make Change Case in Excel a format rather than formula Kevin Excel Worksheet Functions 1 March 18th 05 08:53 PM
Often-Used Code not working in a new Workbook Steve Excel Discussion (Misc queries) 2 December 16th 04 11:55 PM
Stubborn toolbars in Excel 007 Excel Discussion (Misc queries) 9 December 11th 04 02:02 PM


All times are GMT +1. The time now is 03:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"