title: Window not visible despite running in background
body: <p>I have a macro that I'm trying to run through Access that will open up an excel sheet, do some actions on it, and then leave the sheet open.</p>
  
  <p>I have most of it working, with the exception of not being able to get my excel document to open visibly. If I check the task manager, an excel process is running in the background so something does happen, just nothing that I can physically see.</p>
  
  <p>I've attempted to sample some code found through stackoverflow and other resources, which I'm sure you'll see some of that in my current code. But I tried for about an hour with no avail. </p>
  
  <pre><code>Private Sub Command1_Click()
  
  Dim fd As FileDialog
  Dim MySheetPath As String
  Dim Xl As Excel.Application
  Dim XlBook As Excel.Workbook
  Dim XlSheet As Excel.Worksheet
  
  On Error GoTo ErrorHandler
  'allowing selection of the time
  Set fd = Application.FileDialog(msoFileDialogFilePicker)
  
  fd.AllowMultiSelect = False
  
  If fd.Show = True Then
      If fd.SelectedItems(1) &lt;&gt; vbNullString Then
          MySheetPath = fd.SelectedItems(1)
      End If
  Else
      End
  End If
  
  Set Xl = CreateObject("Excel.Application")
  Set XlBook = GetObject(MySheetPath)
  
  ShowaWindow (MySheetPath)
  
  Set XlSheet = XlBook.Worksheets(1)
  
  XlSheet.Rows(2).EntireRow.Insert
  XlSheet.Range("D2") = "ABC"
  
  Set Xl = Nothing
  Set XlBook = Nothing
  Set XlSheet = Nothing
  
  Exit Sub
  
  ErrorHandler:
  Set fd = Nothing
  MsgBox "Error " &amp; Err &amp; ": " &amp; Error(Err)
  
  End Sub
  
  Sub ShowaWindow(sFileName As String)
  Dim oWb As Workbook
  
  Set oWb = GetObject(sFileName)
  
  For Each oWb In Workbooks
      If LCase(oWb.Name) &lt;&gt; LCase(sFileName) Then
          oWb.Windows(1).Visible = True
          Exit For
      End If
  Next
  
  End Sub
  
  </code></pre>
  
  <p>Ideally I would like to be able to see the worksheet appear.</p>