+ Reply to Thread
Results 1 to 6 of 6

Macro form in background after start

  1. #1
    Registered User
    Join Date
    02-09-2023
    Location
    Budapest, Hungary
    MS-Off Ver
    O365
    Posts
    3

    Macro form in background after start

    Hi ExcelForum,

    I do not understand in Excel Macro, please help me.
    I am not newbie in Macro programming, but I have not been able to solve this problem yet.

    Problem:
    In my program when I open this Excel, the program starts with a main menu (Main Form).
    From this main menu form I can choose with button any other form.

    In any time I use not only one Excel file, but 3 - 4 Excel file are in open state in same time.
    My problem: In this time when my program starts the main menu appers on screen not in foreground, but background covering another Excel window.

    It's annoying to have to search the main menu.

    How can I solve the main menu Form appers in foreground every time after I open excel-macro program?

    I attach 2pictures:
    - main menu covered situation
    - on other picture what I would like to see

    Do you have any idea?
    Thanks in advance
    Nokbaratja
    Attached Images Attached Images

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Macro form in background after start

    Pictures are of little (or no) value: please see the yellow banner at top of the page on how to attach a sample workbook.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    02-09-2023
    Location
    Budapest, Hungary
    MS-Off Ver
    O365
    Posts
    3

    Re: Macro form in background after start

    Hi John,

    You are right.
    I attach a simple workbook with simple macro.

    Is it good?

    Thanks
    nokbaratja
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,224

    Re: Macro form in background after start

    I think the problem lies in the wrong order of commands.
    1. remove the UserForm_Initialize procedure from the MainMenu form module.
    2. set the ShowModal property to True in the MainMenu form.
    3. change the code of the Workbook_Open procedure:
    Please Login or Register  to view this content.
    .

    Note that if you would swap the order of the lines to
    Please Login or Register  to view this content.
    the form would bind to the workbook window (let's conventionally call it AAA) that was active when the Tapszer_Teszt workbook was opened. The result is that the MainMenu does not show up with the activation of Tapszer_Teszt, but when the AAA workbook is activated.

    Artik

  5. #5
    Registered User
    Join Date
    02-09-2023
    Location
    Budapest, Hungary
    MS-Off Ver
    O365
    Posts
    3

    Re: Macro form in background after start


    Thanks Artik - it works

    ps:
    polak wegier dwa bratanki....

  6. #6
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,224

    Re: Macro form in background after start

    ... együtt harcol, s issza borát.

    If you think the problem has been solved, mark the thread as solved.

    Artik
    Last edited by Artik; 02-10-2023 at 08:13 AM.

+ 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. Trying to create a form that marks in the background
    By OMANTO1 in forum Excel General
    Replies: 1
    Last Post: 09-08-2020, 07:57 AM
  2. Delete Sku's that start with 7 in an order form macro
    By lilmosweet in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-16-2017, 08:43 PM
  3. [SOLVED] Can’t Change Form Background Color
    By oskar44 in forum Excel General
    Replies: 2
    Last Post: 06-02-2015, 03:20 PM
  4. [SOLVED] Help me streamline my code? Determine form button background from form text box
    By tivofan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-31-2013, 10:09 AM
  5. Using the target command to start user form macro
    By HP RodNuclear in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-07-2011, 02:45 PM
  6. How to start a VB6 program form Excel VBA macro code ?
    By Øyvind in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-27-2005, 12:55 PM
  7. [SOLVED] Gradient form background
    By SkylineGTR in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-12-2005, 08:30 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