title: VBA Centre Userform On Active Screen
body: <p>I wonder whether someone can help me please.</p>
  
  <p>I'm using the 'Extract' code below which runs on the click of a button, which also, as you may be able to see, initalises a 'Splash' form with a scrolling progress bar.</p>
  
  <pre><code>Private Sub btnFetchFiles_Click()
  
      Dim j As Integer
  
      'Display the splash form non-modally.
      Set frm = New frmSplash
      frm.TaskDone = False
      frm.prgStatus.Value = 0
  '    frm.Show False
  
      For j = 1 To 1000
          DoEvents
          Next j
  
          iRow = 20
          fPath = "\\c\s\CAF1\Dragon Mentor Group\Dragon Scripts\Current\April 2015"
          If fPath &lt;&gt; "" Then
              Set FSO = New Scripting.FileSystemObject
              frm.prgStatus.Value = 10
              If FSO.FolderExists(fPath) &lt;&gt; False Then
                  frm.prgStatus.Value = 20
                  Set SourceFolder = FSO.GetFolder(fPath)
                  IsSubFolder = True
                  frm.prgStatus.Value = 30
                  Call DeleteRows
                  frm.prgStatus.Value = 40
                  If AllFilesCheckBox.Value = True Then
                      frm.prgStatus.Value = 50
                      Call ListFilesInFolder(SourceFolder, IsSubFolder)
                      frm.prgStatus.Value = 60
                      Call ResultSorting(xlAscending, "C20")
                      frm.prgStatus.Value = 70
                  Else
                      Call ListFilesInFolderXtn(SourceFolder, IsSubFolder)
                      frm.prgStatus.Value = 80
                      Call ResultSorting(xlAscending, "C20")
                      frm.prgStatus.Value = 90
                  End If
                  Call FormatCells
                  lblFCount.Caption = iRow - 20
                  frm.prgStatus.Value = 100
              End If
          End If
   frm.TaskDone = True
          Unload frm
  'The row below creates a 'On Screen' message telling the user that the workbook has been built.
          iMessage = MsgBox("All the files have been extracted", vbOKOnly)
  'The row below automatically takes the user to the "Launch Sheet".
      End Sub
  </code></pre>
  
  <p>Because I'm using dual monitors I've been researching how to centre the splash screen ont the 'Active Window'and one of the many posts has led me to use the code below:</p>
  
  <pre><code>Private Sub UserForm_Initialize()
  
      Me.BackColor = RGB(174, 198, 207)
          With frmSplash
              .StartUpPosition = 0
              .Left = Application.Left + (0.5 * Application.Width) - (0.5 * .Width)
              .Top = Application.Top + (0.5 * Application.Height) - (0.5 * .Height)
      .Show
  End With
  End Sub
  </code></pre>
  
  <p>The problem I now have is that although the 'Splash' screen is visible and now centred to the active window the extract macro no longer works and I'm really not sure why.</p>
  
  <p>I just wondered whether someone could look at this please and let me know where I've gone wrong.</p>
  
  <p>Many thanks and kind regards</p>
  
  <p>Chris</p>