Data Validation Error

R

Risky Dave

Hi,

As part of the functionality of a workbook I'm developing, a macro adds a
new data line to a page. One of the cells is validated from a drop-down list:

' Risk Categorisation data validation

FormatRange = "j" & RiskCount + 5
Range(FormatRange).Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
Operator:= _
xlBetween,
Formula1:="="Assumption,Commercial,Communications,Corporate/Strategic,Dependency,Economic/financial/market,Environmental/Force
Majeure,Governance,Organisational management/human
factors,Political/societal,Quality,Requirements,Schedule,Security,Technical -
Operational,Technical - Infrastructure,Technical - Software,Testing,3rd Party
- Customer,3rd Party - Supplier"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

When I run the macro that inserts new line it works perfectly, including the
data validation. However, after saving and exiting the workbook, when I
re-open it I get an error message:

"Excel found unreadable content <workbook name here> do you want to recover
the contents of this workbook?"

This offers me a yes/no option. If I select yes, the workbook continues to
open but the validation is lost. This runs before a Workbook_Open function.

After the Workbook_Open function has completed, the following message is
displayed:

"Removed Feature: Data validation from /xl/worksheets/sheet4.xml part"

This has a link to an error log that basically tells me that the validation
has been removed.

Can anyone tell me:
1) What is happening?
2) How do I fix it (I've only just added the validation values. Previously
I had a holding statement to the effect of "Insert validation values here"
which worked fine)

This is under Vista on XL '07 if that makes any difference.

TIA

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top