+ Reply to Thread
Results 1 to 2 of 2

VBA \ Macros \ Forms \ Workbook \ Failed to create new workbook

  1. #1
    Registered User
    Join Date
    10-25-2017
    Location
    mmmm
    MS-Off Ver
    2016
    Posts
    15

    VBA \ Macros \ Forms \ Workbook \ Failed to create new workbook

    Hi everyone,
    Im having a hard time with this and I really expect you to help me please.

    I have a form with a button, that button shows another form with another button, without hiding the previous form. Everything works fine so far. So in the second form, i've got the button so when you click it, it creates a new workbook. I've got the application to be hidden, this means that when you run the application, it opens just the forms, you can't see the worksheets nor the workbook.

    Please Login or Register  to view this content.
    When I click on the button to create a new workbook, it creates the new workbook BUT it takes "control" of the application. This means that if I want to close this new created workbook, the application closes too. I don't want this to happen.
    Here's the code of the button:


    Please Login or Register  to view this content.
    BUUUUUUUUUUUUUUUUUUUUT if I make visible the application (make workbook appear changing Application.Visible = True), it works fine, if I close the new workbook, the application doesnt close. That's what I need,

    I NEED TO OPEN THE APPLICATION WITHOUT SHOWING THE APP'S WORKBOOK, CREATE A NEW WORKBOOK, BEING CAPABLE TO SAVE OR DO WHATEVER I WANT WITH THIS NEW WORKBOOK (EVEN CLOSING IT) WITHOUT HARMING THE APPLICATION.


    Things to make clear:
    • ShowModal on both formularies are FALSE
    • Im not hiding the first form
    • When I create the workbook, I want to close that second form that creates the workbook and return to the first one automatically

    I'm expecting to have other option rather than always showing the workbook of the app, that wouldn't be aesthetic.
    Thanks for your help

  2. #2
    Registered User
    Join Date
    02-14-2013
    Location
    Cedar Rapids, Iowa
    MS-Off Ver
    Excel 2010, Excel 2016, Office365
    Posts
    4

    Re: VBA \ Macros \ Forms \ Workbook \ Failed to create new workbook

    Is this different from your other post?

    https://www.excelforum.com/excel-pro...le-itself.html

    I'm trying to understand exactly what it is that you mean.

    If this is similar to what you are doing with the other thread, try ActiveWindow.Visible = False right after you create the new workbook. Then if you are trying to "close" that workbook at some point, or perform other actions to it, it will remain hidden (similar to the personal workbook).

    Let me know if this helps, or if you can work with me to understand a little better, I would be happy to try and help.

+ 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. Replies: 4
    Last Post: 04-04-2016, 04:09 AM
  2. Replies: 2
    Last Post: 08-11-2015, 07:04 PM
  3. How do I copy a macros from my workbook to another user's workbook?
    By khughes46 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-27-2015, 07:02 PM
  4. Can't access macros in personal.xlsb workbook from macros in a second workbook
    By JimFM in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-24-2013, 03:35 PM
  5. [SOLVED] Need help linking 2 macros: create workbook and split into many worksheets
    By esmithqg in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-13-2012, 06:27 PM
  6. Replies: 20
    Last Post: 07-26-2012, 04:02 PM
  7. [SOLVED] Does Conditional Formatting create macros in my workbook?
    By Kristin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-17-2006, 10:25 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