+ Reply to Thread
Results 1 to 3 of 3

Msgbox help

Hybrid View

  1. #1
    Registered User
    Join Date
    06-08-2010
    Location
    Cincinnati
    MS-Off Ver
    Excel 2000
    Posts
    28

    Msgbox help

    I have a workbook that creates a temp workbook via workbooks.add. After the new workbook is created, I leave it open so it is the active workbook and in te original workbook vba, i create a msgbox to pop up over the temp workbook and not the original workbook. This does not work the first time I run the process, but every time after. The first time I run the process, the msgbox is not visible unless I click the original workbook. I want the temp workbook to be visible and maximized and the msgbox over it. It's like it has to wake up or something.

    I realize that this may be hard to visualize, but I appreciate any help offered.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Msgbox help

    markv,

    If it only has one other workbook open at a time, you could add this code to ensure that it acts the way you need it to:

        Workbooks.Add
        For Each wbk In Workbooks
            If wbk.Name <> ThisWorkbook.Name Then
                wbk.Activate
                MsgBox "hello"
            End If
        Next


    Hope this helps,
    ~tigeravatar

  3. #3
    Registered User
    Join Date
    06-08-2010
    Location
    Cincinnati
    MS-Off Ver
    Excel 2000
    Posts
    28

    Re: Msgbox help

    Thanks for your help, Tiger. I can get it to work, but it never works the first time. When I step through the code, it works the first time. I wonder if I need do events.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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