Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Project One - Nearly done - Protection issues

Well I am nearly finished with my first ever Excel spreadsheet
using VB! Thanks to all of you here who have helped me out sooo much!
I could have picked a much easier project but I would not learn as
much as I have already. I am also looking around for good books to
help me along further.

I have one last problem with “Project One” It adds and removes
data lines quite nicely, it all was working great, until…I wanted to
protect all the cells, rows and formatting from being messed up by a
user, so I protected the worksheet. The problem is now that my code is
not being allowed to Insert, delete, and reformat the cells as need.
It crashes with a “Run Time error 1004”

Any suggestions?





  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Project One - Nearly done - Protection issues

Unprotect before the inserts and deletes, do that, the protect again.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Dean Goodmen" wrote in message
...
Well I am nearly finished with my first ever Excel spreadsheet
using VB! Thanks to all of you here who have helped me out sooo much!
I could have picked a much easier project but I would not learn as
much as I have already. I am also looking around for good books to
help me along further.

I have one last problem with "Project One" It adds and removes
data lines quite nicely, it all was working great, until.I wanted to
protect all the cells, rows and formatting from being messed up by a
user, so I protected the worksheet. The problem is now that my code is
not being allowed to Insert, delete, and reformat the cells as need.
It crashes with a "Run Time error 1004"

Any suggestions?







  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Project One - Nearly done - Protection issues

Hi Dean,

You can set the UserInterfaceOnly argument to the Protect method to True
(works for Sheet-level protection only) via code. This will allow your code
to modify the sheet, but will protect it against changes by the user. This
setting only lasts as long as the workbook is open - when you reopen, it
will revert to being "fully-protected". If you want this behavior every
time the workbook opens, you could put the following line of code in the
Workbook_Open event subroutine:

Sheet1.Protect Password:="test", UserInterfaceOnly:=True

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Dean Goodmen wrote:
Well I am nearly finished with my first ever Excel spreadsheet
using VB! Thanks to all of you here who have helped me out sooo much!
I could have picked a much easier project but I would not learn as
much as I have already. I am also looking around for good books to
help me along further.

I have one last problem with "Project One" It adds and removes
data lines quite nicely, it all was working great, until.I wanted to
protect all the cells, rows and formatting from being messed up by a
user, so I protected the worksheet. The problem is now that my code is
not being allowed to Insert, delete, and reformat the cells as need.
It crashes with a "Run Time error 1004"

Any suggestions?


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
Cell protection issues Stuart Mantel[_2_] Excel Discussion (Misc queries) 0 August 21st 08 08:03 PM
worksheet protection issues robyn Excel Worksheet Functions 2 November 26th 06 11:55 PM
Worksheet protection issues - HELP! kpriyac Excel Discussion (Misc queries) 2 August 16th 06 07:42 PM
protection issues . . . HELP! Wayne Knazek Excel Discussion (Misc queries) 3 July 5th 06 09:31 PM
Protection issues [email protected] Excel Discussion (Misc queries) 1 June 27th 05 03:54 PM


All times are GMT +1. The time now is 09:11 PM.

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

About Us

"It's about Microsoft Excel"