+ Reply to Thread
Results 1 to 10 of 10

How to Keep the Wokbook Invisible after Saving Another

  1. #1
    Registered User
    Join Date
    11-04-2017
    Location
    Upington, South Africa
    MS-Off Ver
    MS Office 2013
    Posts
    11

    How to Keep the Wokbook Invisible after Saving Another

    Hello,
    Hope you are well.

    I have a Userform that when it opens, on Initialize, it makes the Soil Health Assessment workbook invisible with
    Please Login or Register  to view this content.
    The Userform is used to fill in soil information in a vineyard. When finished the User press or click a button that firstly opens a workbook in a Dropbox folder that contains a database and appends the soil info to the database before closing, secondly it emails a pdf version of the soil info. After this the Userform Unloads and Shows again so a user can assess the soil again.

    The problem is when the database workbook is saved with
    Please Login or Register  to view this content.
    for some reason the Soil Health Assessment workbook becomes visible if I open another workbook.

    Can someone please help to assess why this behaviour occurs?

    Regards

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: How to Keep the Wokbook Invisible after Saving Another

    Goeie Naand, Hmerman,

    Welkom by hierdie Forum!

    See this Link

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Registered User
    Join Date
    11-04-2017
    Location
    Upington, South Africa
    MS-Off Ver
    MS Office 2013
    Posts
    11

    Re: How to Keep the Wokbook Invisible after Saving Another

    Naand Winon,
    Dankie!

    I see what the linked code does, it makes a single Workbook invisible. The thing is that it is the fact that my Soil Health Assessment workbook stays invisible after executing the code, but only becomes visible if I or the User opens any other Workbook.

    What I want to know does the
    Please Login or Register  to view this content.
    code influence the visibilty; OR

    WILL a second line of executing the
    Please Login or Register  to view this content.
    code make the workbook visible (as I understand two False iterations still equals False).

    Groete,

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: How to Keep the Wokbook Invisible after Saving Another

    Middag Hmerman,

    Verskoon die Engels, ter wille van die Forum.

    I do not have access to Excel 2013, and I don't know if it is to be "Blamed" either. I have tested your problem in Excel 2010, and cannot replicate the issue you have. The Hidden Workbook remains Hidden whatever I do, until I Unhide it.

    If your problem persists, may I suggest that you, attach a sample workbook with your complete Code, etc..

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate.


    Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

    Groete.

  5. #5
    Registered User
    Join Date
    11-04-2017
    Location
    Upington, South Africa
    MS-Off Ver
    MS Office 2013
    Posts
    11

    Re: How to Keep the Wokbook Invisible after Saving Another

    Naand Winon,
    Soos jy se, ter wille van die forum.

    I cannot give you the Userform as is. But I made a mock up (see attached file Toets_Close.xlsm): you only need to download, open and click Update Database.
    It will create the database file and transfer a mock static data table to the database. Click Close to Unhide.

    Partly solved:
    I solved the issue by adding the line
    Please Login or Register  to view this content.
    right at the end (I left you a comment), but importantly I noticed that my Userform's ShowModal property was set to False. I set it to True.

    The only issue now is that I cannot open the Database file while the Userform Shows, but I can create a new file and save it without
    unhiding the workbook.

    Can you help me with opening the database file or is that an effect of the ShowModal property?

    Groete
    Attached Files Attached Files

  6. #6
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: How to Keep the Wokbook Invisible after Saving Another

    Goeie More, Hmerman,

    Jy gooi 'n taai toffie!

    I got up at 2 am this morning, to tackle your clear as mud effort.LOL

    Just kidding. There is a big difference between Hiding a Workbook and setting the visibility of an Application(Excel) to False. Please try to steer a wide berth from this practice until you are totally confident with your Coding skills, and knowledge of same, as it may cause havoc with program failures and "Crashes". One example was your Userform which you could just close, making you believe that you have exited Excel, while "back at the ranch", it is not the case. Excel is still running in the background, and waits to pounce when you try something else in or with any other Code and or Workbook!

    I have also taken the liberty to change a few other things. The "Update Database" Button has been removed from the userform, and it now appears within the Sheet itself. Try it, and you will see what it does. Some control measures were attached to it to prevent it from repeatedly appending the same data to the existing "Databasis".

    It might be necessary for you to change references to Directories in the Code, to suit.

    Please see if you can make do with the Workbook as I have it now, or let me know if you would want it changed.

    Lekker dag.
    Attached Files Attached Files

  7. #7
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: How to Keep the Wokbook Invisible after Saving Another

    Hi Hmerman,

    Yet another option, where I forgot to add selecting the "Databasis". This can only be done from within the sheet in the "Toets" Workbook though.

    Is this O.K. with you?

    Groete.
    Attached Files Attached Files
    Last edited by Winon; 04-24-2018 at 04:49 AM. Reason: Corrected Code

  8. #8
    Registered User
    Join Date
    11-04-2017
    Location
    Upington, South Africa
    MS-Off Ver
    MS Office 2013
    Posts
    11

    Re: How to Keep the Wokbook Invisible after Saving Another

    Haai Winon,
    Baie dankie hiervoor!

    Just to clarify, I sent you a bare minimum of my Userform and Spreadsheet (as requested) that consist of a 6 page Multipage with Option - and Check buttons as well as with a Button and Image control that opens the Windows Camera App and loads the Latest jpg file into the Image Control (I included only the code I struggled with and a mock up Userform with two buttons). This excluded the QueryClose Event where the closemode checked for values 0, 1, 2 and 3 depending on what the User does. Of course you did not know this, therefore I am sorry I did not include it in my explanation.
    The static database table (that never grows) consists of formulas that calculates the Soil Health Information that the User of the Userform inputs on the Userform and the Database is either created (if it does not exist) or the values are appended to existing data in the database that sits in dropbox that is linked to a Excel Spreadsheet with a pivot table that refreshes from the database, I also do not want the user to fiddle with the spreadsheet from which the static database gets it value i.e. xlVeryHidden sheets. This I also did not explain like in this long winded paragraph. So sorry.
    *I would love to use PostgresSQL or something similar for the database, but I do not know SQL and how to get the data into the database over the Internet or how to accommodate 30 users' data at the same time.

    The above reason is why I use the
    Please Login or Register  to view this content.
    method. It also looks and feels like a very very light app.

    With regards to my problem code you solved it:
    Firstly, I should always use the Application.Visible method with QueryClose Event. As in your example.
    Secondly, as I can glean from your examples, setting the ShowModal to True means I cannot open a saved Workbook or work in one.

    With regards to your question:
    Yes, it is O.K. as I did not think about using Counta to validate the static database with the GrondGData Array size.

    Thank you very much.

    Mooi dag vir jou ook.

    Groete,
    Last edited by Hmerman; 04-24-2018 at 09:50 AM.

  9. #9
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: How to Keep the Wokbook Invisible after Saving Another

    Hi Hmerman,

    Thank you for the feedback. If you have that many other undisclosed controls and features in your setup, it might not even be necessary for the Counta bit, since the Pivot Table should take care of that.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Dankie, en voorspoed met jou projek.

  10. #10
    Registered User
    Join Date
    11-04-2017
    Location
    Upington, South Africa
    MS-Off Ver
    MS Office 2013
    Posts
    11

    Re: How to Keep the Wokbook Invisible after Saving Another

    Haai Winon,
    Will do, thanks alot for your interest and help.

    Groete,

+ 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. [SOLVED] help with data from a second wokbook in the open workbook
    By jmac1947 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-09-2014, 06:18 AM
  2. Protecting wokbook - control deletions
    By Bananna1 in forum Excel General
    Replies: 1
    Last Post: 12-13-2013, 01:02 PM
  3. Change decimal separator format in a wokbook
    By poseido in forum Excel General
    Replies: 0
    Last Post: 09-01-2011, 10:56 AM
  4. Split up wokbook into 2-3 files
    By JK1234 in forum Excel General
    Replies: 0
    Last Post: 12-08-2008, 11:45 AM
  5. Copying invisible columns, but not invisible rows
    By petalred in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-04-2008, 11:17 AM
  6. Lock down a wokbook
    By Gordon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-19-2006, 02:15 PM
  7. Convert a wokbook to shared mode
    By Don Rouse in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-16-2005, 12:05 PM

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