+ Reply to Thread
Results 1 to 17 of 17

Data Validation issue - stops on close

  1. #1
    Registered User
    Join Date
    04-13-2012
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2003
    Posts
    29

    Data Validation issue - stops on close

    Hi all,

    I got some help with a data validation issue yesterday. See link:

    http://www.excelforum.com/excel-gene...alidation.html

    Original file that I adapted is here.

    http://www.excelforum.com/attachment...-sample-1-.xls

    The problem I'm having is that the data validation - which references named ranges - stops when the workbook is closed. I open the file again and the drop down lists stop working. I go back into data validation and the formulas are all still there, then the drop down boxes start working again.

    Is there any reason why this would happen? I'm trying to avoid having to go into data vaildation every time I open the workbook.

    I'm using 2010 - it's possible that the document will get used on a machine running 2007. The named ranges are all on this file.

    Cheers,
    Rob

  2. #2
    Registered User
    Join Date
    04-13-2012
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: Data Validation issue - stops on close

    Hi again,

    Spent a few hours going through the possible reasons for the problem. It was all going along fine and I thought I was making it up until I enabled macros, then the data validation stopped working.

    I tried it on the original file in the previous post - saved as macro enabled workbook - and the data validation stopped loading automatically. Anyone know if it's possible to use macros and this type of data validation or am I doomed to one or the other?

  3. #3
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Data Validation issue - stops on close

    try these suggestions out
    http://www.contextures.com/xlDataVal...rowsNotVisible

    sounds like

    Corruption
    If none of the above solutions explains the missing dropdown arrows, the worksheet may be corrupted
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Data Validation issue - stops on close

    Are you trying to use a Data Validation list from a closed workbook? I don't think Excel would know anything about a closed file.

    If that isn't the problem then bump this post.

    Read the first few sentences of:
    http://www.ozgrid.com/VBA/ExtractFromClosedWorkbook.htm
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  5. #5
    Registered User
    Join Date
    04-13-2012
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: Data Validation issue - stops on close

    Thanks again humdingaling...

    I'm at work running IE which crashes everytime it needs to think about anything. I'll check the website out at home.

    I should clarify, the arrows are definately there. They just don't do anything until I click on data validation. The formula is all there. I click ok and it starts working again.

    It's pretty annoying. I don't think the file is corrupted because I've tried using this named range and DV on a few worksheets. They all failed when saved as macro enabled.

    Cheers anyway.

  6. #6
    Registered User
    Join Date
    04-13-2012
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: Data Validation issue - stops on close

    Thanks MarvinP,

    I'm not clever enough to use a DV list from a closed file.

    Not to waste anyone's time but if you have 2 minutes....

    http://www.excelforum.com/attachment...-sample-1-.xls

    Save this file (presumably it works) - open file - save as macro-enabled - close file - open file

    Do the drop down arrows still work after that?

  7. #7
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Data Validation issue - stops on close

    hmm i managed to replicate it
    i really stumped on this one...just feels like a straight out bug

    attached example for anything following

    B2:b32 all have DV associated but opening opening file the arrow is there but not drop down
    Attached Files Attached Files

  8. #8
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Data Validation issue - stops on close

    Hi,

    It looks like the DV is using a type of Dynamic Named Range to determine what to show. If you go to the formula of the DV it shows a formula of:
    =OFFSET(name,MATCH(LEFT(B2,LEN(B2)),LEFT(names,LEN(B2)),0),0,SUMPRODUCT(--(LEFT(names,LEN(B2))=B2)),1)

    Does that answer the question? It looks like the formula above uses the Normal Named Range (name) to calculate what to show.

  9. #9
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Data Validation issue - stops on close

    MarvinP - download the original file in post #1

    when you open that one all the DVs in column b work as intended without having to go into DV to "reactivate" the DV

    the query then is what does MACRO enabled workbook do to the file to make it stop working like the original file

  10. #10
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Data Validation issue - stops on close

    There is a formula in the DV as shown in post 8.
    There are also named ranges with formulas shown in the names manager.

    I wonder if the problem might be that "Name" is a reserved word in VBA. Change the range names away from "name" and "names" and see what happens.

    I guess I trust Excel to do things correctly and try to change my thinking to match what it does. I just can't get my head around what the OP expects it to do, or not do in this thread.

  11. #11
    Registered User
    Join Date
    04-13-2012
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: Data Validation issue - stops on close

    Hi Marvin,

    Thanks for the help.

    The formula in post 8 works when the document is a .xls file. If you save as an .xlsm file (as in post 7) the DV stops working when you open the file despite all the formulas still being there. You then have to click on Data Validation to get it to work. Something happens when the file format is changed from an .xls to a .xlsm that I just don't understand.

    I guess I could double down on the macro enable content and write a macro that automatically clicks on the data validation button on startup?
    Last edited by Homeslice01; 02-27-2014 at 01:48 AM. Reason: apologies *.xlsm*

  12. #12
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Data Validation issue - stops on close

    That makes a lot more sense now that you say it is an .xls vs .xlsm type problem. .xlsm are a lot more secure and ask to run a macro while the older .xls could have viruses that ran automatically.
    http://www.differencebetween.net/tec...-xls-and-xlsx/ gets close to this problem but not enough detail..
    http://msdn.microsoft.com/en-us/libr...ffice.12).aspx is closer to a better answer... Read down to section of "Macro-Enabled Files vs. Macro-Free Files"

  13. #13
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Data Validation issue - stops on close

    the fault replicates when saving as XLSX as well ,so its not just XLSM

    im stumped, sorry homeslice
    yes you can create macro to run DV on opening
    you just need to place it in Workbook_Open

    it does work i just tried it on the sample file
    Last edited by humdingaling; 02-27-2014 at 02:30 AM.

  14. #14
    Registered User
    Join Date
    04-13-2012
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: Data Validation issue - stops on close

    Yes it does seem like I lucked out here.

    I must say it's amazing that a bunch of strangers would put in the time to help me out. You guys are awesome!

    Humdingaling, I'm pretty rubbish at writing macros too. If you could swing me the solution, I'd be grateful.

    Merci.

  15. #15
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Data Validation issue - stops on close

    sorry back from holidays

    attached is example of how to "automatically" apply DV on workbook opening

    the code i got just from recording the application of DV and amending slightly
    may not be the most optimised but it will work
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    04-13-2012
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: Data Validation issue - stops on close

    Hiya Humdinaling,

    Hope your holiday was great. I thought you'd forgotten this and only checked the thread by chance.

    Just updated the security settings and this works fine. Thanks. You're a champ.

  17. #17
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Data Validation issue - stops on close

    not a problem, i usually stay subscribed to threads for quite sometime

    glad it works for you
    if the problem has been solved please closed the thread by marking it solved


    Cheers
    Humdinga

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Auto close excel (2010) at specific time bypassing data validation
    By vstrom22 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-13-2012, 11:53 AM
  2. [SOLVED] Data Validation to stop the use of commas and full stops
    By SallyW-EDUK in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 10-16-2012, 04:31 AM
  3. Data Validation issue
    By TranceDiablo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-01-2011, 10:54 PM
  4. Macro to close/open data validation workbook
    By catccc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2010, 08:20 AM
  5. Validation List Stops working
    By Brian Matlock in forum Excel General
    Replies: 2
    Last Post: 08-19-2005, 04:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1