Announcement

Collapse
No announcement yet.

Unconfigured Ad Widget

Collapse

Message box to pop-up at file open

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Message box to pop-up at file open

    Hi All,

    How can I make a message box apear when a file is opened.

    I have a spread sheet and I need to create a small msg box with a logo (jpg) and some text so that every time it is opened the msg will pop up and dissapear after a second or two.

    Thanx

  • #2
    Re: Message box to pop-up at file open

    Create a userForm, add your logo into an Image control and your message as a label caption.Then use the WorkBook_Open event
    Code:
    Private Sub Workbook_Open()
    
    UserForm1.Show
    End Sub
    Hope that Helps

    Roy

    New users should read the Forum Rules before posting

    For free Excel tools & articles visit my web site

    If I have helped you and you feel like putting your hand in your pocket please make a donation to Children in Need

    RoyUK's Web Site

    royUK's Database Form

    Where to paste code from the Forum

    About me.

    Comment


    • #3
      Re: Message box to pop-up at file open

      Hi Alex,

      You could also add:
      Code:
      Private Sub UserForm_Activate()
          Application.OnTime Now + TimeValue("00:00:03"), "KillTheForm"
      End Sub
      to the Activate event of the form that you want to pop up. This will show the form for 3 seconds.

      Regards,

      Bill

      Comment


      • #4
        Re: Message box to pop-up at file open

        Thanx for the code!

        But, could you give me a step by step.

        I have never used VB!

        Comment


        • #5
          Re: Message box to pop-up at file open

          with a logo (jpg)
          This will be very difficult with a msgbox i suggest looking at a userform to be a place holder for the jpg and show for few seconds to read any text and then carry on with any codes or hide the userform

          jiuk
          Last edited by Jack in the UK; May 5th, 2005, 17:50. Reason: Typo - jiuk

          Comment


          • #6
            Re: Message box to pop-up at file open

            Bit complicated to start from scratch. Do a search for Splash Screen.
            Here is an example. No timer because you might find this too complicated
            Attached Files
            Hope that Helps

            Roy

            New users should read the Forum Rules before posting

            For free Excel tools & articles visit my web site

            If I have helped you and you feel like putting your hand in your pocket please make a donation to Children in Need

            RoyUK's Web Site

            royUK's Database Form

            Where to paste code from the Forum

            About me.

            Comment


            • #7
              Re: Message box to pop-up at file open

              Hi Alex,

              For entering a VBA code follow this:

              Open Excel
              Tools>Macro>Visual Basic Editor
              A new window will open
              Then follow:
              Inser>Form
              insert a new UserForm into the project. This form is named UserForm1. Type your message in this form


              Now as I understand, you are looking for a splash screen which will be shown when an excel file opens and then automatically disapears it after some time.


              Now click on the "ThisWorkbook" in Project -VBAProject window at left side and paste the following code into the right pane
              Code:
              Private Sub Workbook_Open()
                  UserForm1.Show
              End Sub
              Now double click on the UserForm1 in left side pane and paste the following code:
              Code:
              Private Sub UserForm_Activate()
                  Application.OnTime Now + TimeValue("00:00:05"), "KillTheForm"
              End Sub
              Now click Insert>Module and
              Insert the following subroutine into right side pane.
              Code:
              Private Sub KillTheForm()
                  Unload UserForm1
              End Sub
              That's it!

              Niko
              Last edited by royUK; May 5th, 2005, 18:03. Reason: add code tags, please use when posting codes

              Comment


              • #8
                Re: Message box to pop-up at file open

                Hi Alex,

                I have attached a small example. If you use this as a Template and copy your data from your file into this, then it is much easier than trying to talk you through VBA.

                If you press Ctrl+F11 together you will see the VBA screen. On the left hand side of the screen you will see UserForm1. Double click this and then click in the label that says "Company Name". Make sure on the left of the screen that the Properties are showing (It should show Properties-UserForm1). If not, click the Properties Window Icon (The hand holding the paper on the toolbar), double-click the Caption property and you can change the message in the label to whatever you want. You can re-size the label by dragging the handles around it. When you have finished, click Alt+F11 to return to Excel.

                Regards,

                Bill

                Regards,

                Bill
                Attached Files

                Comment


                • #9
                  Re: Message box to pop-up at file open

                  Thanx!

                  Comment

                  Trending

                  Collapse

                  There are no results that meet this criteria.

                  Working...
                  X