Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Below code works fine as long as I do not protect my workbook, but gives an error when protected. How to solve this ? Runtime error '-2147417848 (80010108)' Method 'Modify' of object 'Validation failed' With Worksheets(1).Range("G14").Validation .Modify xlValidateDecimal, xlValidAlertStop, xlBetween, "1.0", "7.0" .ErrorMessage = "Enter value between 1,0 and 7,0" + EOL + "Use end of line" .ShowInput = False .ErrorTitle = "Invalid input" .ShowError = True End With I've already tried ActiveWorkbook.Unprotect, Add Type iso Modify and Validation.delete before add / modify. None of these alternatives seem to work. Cell G14 is not locked and not hidden. Why is protect workbook causing this error, and how to solve this ? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you unprotect your workbook in code, execute the command and reprotect the
workbook (all in code) and you say that a protected workbook is the cause of the problem, then that should fix it. -- Regards, Tom Ogilvy "Tom Emmery" wrote: Hi, Below code works fine as long as I do not protect my workbook, but gives an error when protected. How to solve this ? Runtime error '-2147417848 (80010108)' Method 'Modify' of object 'Validation failed' With Worksheets(1).Range("G14").Validation .Modify xlValidateDecimal, xlValidAlertStop, xlBetween, "1.0", "7.0" .ErrorMessage = "Enter value between 1,0 and 7,0" + EOL + "Use end of line" .ShowInput = False .ErrorTitle = "Invalid input" .ShowError = True End With I've already tried ActiveWorkbook.Unprotect, Add Type iso Modify and Validation.delete before add / modify. None of these alternatives seem to work. Cell G14 is not locked and not hidden. Why is protect workbook causing this error, and how to solve this ? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Tom,
I've tried unprotect before (and protect after) below code, but this doesn't change the error. ActiveWorkbook.Unprotect Or should I use other code to resolve ? Greets, Tom "Tom Ogilvy" wrote: If you unprotect your workbook in code, execute the command and reprotect the workbook (all in code) and you say that a protected workbook is the cause of the problem, then that should fix it. -- Regards, Tom Ogilvy "Tom Emmery" wrote: Hi, Below code works fine as long as I do not protect my workbook, but gives an error when protected. How to solve this ? Runtime error '-2147417848 (80010108)' Method 'Modify' of object 'Validation failed' With Worksheets(1).Range("G14").Validation .Modify xlValidateDecimal, xlValidAlertStop, xlBetween, "1.0", "7.0" .ErrorMessage = "Enter value between 1,0 and 7,0" + EOL + "Use end of line" .ShowInput = False .ErrorTitle = "Invalid input" .ShowError = True End With I've already tried ActiveWorkbook.Unprotect, Add Type iso Modify and Validation.delete before add / modify. None of these alternatives seem to work. Cell G14 is not locked and not hidden. Why is protect workbook causing this error, and how to solve this ? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro error when worksheet is protected | Excel Discussion (Misc queries) | |||
1004 Cell Protected Error for data validation lists when locked and protected | Excel Programming | |||
error accessing a protected worksheet | Excel Worksheet Functions | |||
Validation.Modify Runtime Error in Protected Worksheet | Excel Programming | |||
Excel VBA error on protected worksheet | Excel Programming |