title: How can I stop Excel workbook flicker on automation open?
body: <p>I'm using GetObject with a workbook path to either create a new or grab an existing Excel instance. If it's grabbing an existing user-created instance, the application window is visible; if the workbook path in question is closed, it will open and hide, but not before it flickers on the screen. <code>Application.ScreenUpdating</code> does not help with this.</p>
  
  <p>I don't think I can use the Win32Api call LockWindowUpdate, because I don't know whether I'm getting or creating before the file is open. Is there some other VBA-friendly way (i.e. WinAPI) to freeze the screen long enough to get the object?</p>
  
  <p><strong>EDIT</strong>: Just to clarify, because the first answer suggests using the Application object... These are the steps to reproduce this behavior.
  1. Open Excel--make sure you're only running one instance--save and close the default workbook. Excel window now visible but "empty"
  2. Open Powerpoint or Word, insert a module, add the following code</p>
  
  <pre><code>Public Sub Open_SomeWorkbook()
      Dim MyObj   As Object
      Set MyObj = GetObject("C:\temp\MyFlickerbook.xlsx")
      'uncomment the next line to see the workbook again'
      'MyObj.Parent.Windows(MyObj.Name).Visible = True'
  
      'here's how you work with the application object... after the fact'
      Debug.Print MyObj.Parent.Version
  End Sub
  </code></pre>
  
  <ol>
  <li>Note the flicker as Excel opens the file in the existing instance, and then hides it... because it's automation</li>
  <li>Note also, however, that there is no application object to work with, until the flickering is done. This is why I'm looking for some larger API method to "freeze" the screen.</li>
  </ol>