+ Reply to Thread
Results 1 to 16 of 16

Items missing after closing and reopening.

  1. #1
    Registered User
    Join Date
    10-20-2014
    Location
    Arkansas
    MS-Off Ver
    2010
    Posts
    41

    Items missing after closing and reopening.

    I have an excel sheet that I put together, in the sheet some combo boxs and check boxs are hidden until the correct option is chosen from some of the visible combo box . It was working perfectly. Then I closed out of it and reopened it and now all the hidden combo box and check boxs are missing. I saved it and even saved it as a back up file. and both files have the same issue. Any help would be great.
    Attached Files Attached Files
    Last edited by CtrlAltDelete; 10-23-2014 at 02:31 PM.

  2. #2
    Registered User
    Join Date
    09-27-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    86

    Re: Items missing after closing and reopening.

    Hi,

    You have write a sub routine in this workbook event to show the user as expected else whatever the earlier was choosen and saved will be shown as it is.

    Private Sub Workbook_Open()

    End Sub

    Regards,
    lokicl

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  3. #3
    Registered User
    Join Date
    10-20-2014
    Location
    Arkansas
    MS-Off Ver
    2010
    Posts
    41

    Re: Items missing after closing and reopening.

    It didn't work. Perhaps I didn't understand you clearly.The code you mentioned was only in the worksheet tab I tried deleting it and I also tried adding it in sheet one with no luck. each time I re-added the boxs. Thank you for the help.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Items missing after closing and reopening.

    Hi CtrlAtlDelete,

    Many of your ComboBoxes have 0 height and several are superimposed on top of each other (have the same left and top such as 87 thru 91). My speculation is that this was not the position and/or sizes of several of the ComboBoxes before you started having problems.

    Unfortunately, situations like this are a known problem that occasionally occurs with Active X Controls such as Active X ComboBoxes. I have the following suggestions (none of which is an easy fix):
    a. Delete the bad Active X ComboBoxes and replace them with new Active X ComboBoxes having the same name and the correct attributes. or
    b. Correct the bad attributes of the Active X ComboBoxes that are corrupt. or
    c. Each time you start the Workbook, delete all the Active X ComboBoxes, and programmatically recreate them. or
    d. Use Forms ComboBoxes to replace the Active X ComboBoxes. This may require a design change in your code.

    Please back up your file before making any changes.

    For example (taken from your worksheet) excerpt from output of Sub DisplayActiveXComboBoxAttributes() (code displayed below):
    Please Login or Register  to view this content.
    The following code contains a couple of tools that may help you with Active X ComboBoxes now and in the future:
    Please Login or Register  to view this content.

    Non-working code excerpt to demo creation of control programmatically:
    Please Login or Register  to view this content.
    Please let me know what additional help you need. I'll do my best to help you get up and working.

    Lewis

  5. #5
    Registered User
    Join Date
    10-20-2014
    Location
    Arkansas
    MS-Off Ver
    2010
    Posts
    41

    Re: Items missing after closing and reopening.

    Lewis
    I am afraid I am a bit new to this.
    Thank you so much for the help, however I seem to have no luck.

    I tried "a. Delete the bad Active X ComboBoxes and replace them with new Active X ComboBoxes having the same name and the correct attributes. "
    That just lost everything again.
    I am afraid that "c. Each time you start the Workbook, delete all the Active X ComboBoxes, and programmatically recreate them." is not functional with over 83 boxs to remake the excel sheet becomes more work than help.

    Option d. "Use Forms ComboBoxes to replace the Active X ComboBoxes. This may require a design change in your code." Tried it but I don't believe that it can do the what i need such as hide or change the list when a selection is made in another combo box.

    I am trying option b. "Correct the bad attributes of the Active X ComboBoxes that are corrupt. " I tried the codes you provided an nothing seems to work.

    I tried
    Please Login or Register  to view this content.
    That really didn't do anything
    I tried the codes as well and nothing is happening should I try maybe putting them in "Thisworkbook" instead of "Sheet 1"?

    Thank again for any help.

  6. #6
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Items missing after closing and reopening.

    I just gave you the options. I think trying to repair the damage is probably the best option. I apologize for you deleting things, because my instructions probably were not clear.

    You need to have a test protocol (i.e. test procedure) to be able to verify that everything is working correctly before you can declare the worksheet finished. It's a pain, but the only way to make sure that everything is in the workbook, especially if it is going to be used by others.

    Let's start off a little more slowly this time. The following is not a macro, but the output from the macro:
    Please Login or Register  to view this content.
    The following Macro created the above (which is a truncated part of the total output). You see the output in the debugger Immediate Window. You access the debugger Immediate Window by entering (CTRL G) in the debugger or by selecting View > Immediate Window in the debugger.
    Please Login or Register  to view this content.


    The following macro (tested on your file) will display various attributes for ComboBox87 and will change the height. You should be able to adapt this to your needs when trying to fix whatever ComboBoxes are corrupt.
    Please Login or Register  to view this content.
    I know this is frustrating, and painful. Most disasters like this seem to occur just when you think you are almost finished. If we take things one step at a time, we should solve your problem. Whenever you have incremental success, you should save a copy of that file as the new baseline.

    Lewis

  7. #7
    Registered User
    Join Date
    10-20-2014
    Location
    Arkansas
    MS-Off Ver
    2010
    Posts
    41

    Re: Items missing after closing and reopening.

    Thank you for the help I have been saving the files each step of the way using "v2, v3," However now that I went back and realized it the others are lost as well.

    Could not get the Sub DisplayActiveXComboBoxAttributes() to show up as you did.

    The Sub ModifyActiveXCheckBox() did pull up something in the Immediate Window, however did nothing on the sheet.

    perhaps I put it in the wrong location? I see what the code is trying to do though, and how if I could get it to work, it could work for all the boxs.

    Sorry for being very ignorant in this area, and thank you for the help.

  8. #8
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Items missing after closing and reopening.

    See if my code in my version of the file works in my version of your file - attached here. All the code is in Module ModLewis.

    Lewis
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    10-20-2014
    Location
    Arkansas
    MS-Off Ver
    2010
    Posts
    41

    Re: Items missing after closing and reopening.

    Ok so after looking at your combo box I realized I was putting it the sheet section or the workbook section and not in the Modules.

    I have manged to get the boxs to show up. however they pop up all in the wrong spot. I tried using
    Please Login or Register  to view this content.
    No luck, also tried using the same code as above but with out the "Debug.Print Sheets("Order Sheet")." that didn't work.

    I can at least see them now I just need them to stop moving. when I hide the rows.

    Also on the Sub ModifyActiveXCheckBox() why is Height in there three times? Can I put it in there once?

    Thank you again.
    Last edited by CtrlAltDelete; 10-22-2014 at 03:03 PM.

  10. #10
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Items missing after closing and reopening.

    Also on the Sub ModifyActiveXCheckBox() why is Height in there three times? Can I put it in there once?
    The first time displays the current value of the height.
    The second time attempts the change the value of the height.
    The third time displays the current value of the height after the attempted change.

  11. #11
    Registered User
    Join Date
    10-20-2014
    Location
    Arkansas
    MS-Off Ver
    2010
    Posts
    41

    Re: Items missing after closing and reopening.

    ok thank you alot is there a way of keeping it from moving

  12. #12
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Items missing after closing and reopening.

    is there a way of keeping it from moving
    Unfortunately, not that I am aware of. It seems to be an unwanted side effect that sometimes happens with Active X controls. When I use Active X controls in a project, I create the controls programmatically. If a problem occurs, I can delete and recreate the controls as needed.

    In a case like yours, if the same specific problem happens all the time, you can make the adjustments automatically by putting the changes you need in Sub Workbook_Open() in the ThisWorkbook Module.

  13. #13
    Registered User
    Join Date
    10-20-2014
    Location
    Arkansas
    MS-Off Ver
    2010
    Posts
    41

    Re: Items missing after closing and reopening.

    ok is how can i put them in there?
    I have tried various ways.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  14. #14
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Items missing after closing and reopening.

    Debug.Print is used only to print things. The code didn't work because there is no ComboBox104 and you probably got a runtime error 438.

    Try code like the following:
    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    10-20-2014
    Location
    Arkansas
    MS-Off Ver
    2010
    Posts
    41

    Re: Items missing after closing and reopening.

    Thank you very much. but running the ModifyActiveXCheckBox() when ever one of the combobox change allows for it to show up correctly. Thank you so much for all you help.

  16. #16
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Items missing after closing and reopening.

    I'm glad it worked out for you. Please let me know if you have any more problems and/or questions.

    Lewis

+ 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. Speed changes after closing and reopening workbook
    By avr5iron in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-16-2011, 10:41 AM
  2. Closing Files and Reopening them in VBA
    By VBAQuest in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2005, 10:55 AM
  3. Userform retain data after closing and reopening
    By Joel Mills in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-20-2005, 04:05 PM
  4. My comments reformat after closing and reopening.
    By Picman in forum Excel General
    Replies: 0
    Last Post: 05-25-2005, 12:06 PM
  5. macro statement will not run a second time without closing and reopening
    By Pete Straman via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2005, 12:06 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