title: Call was rejected by callee in win32com if a dialog box is open or excel is otherwise waiting for the user
body: <p>I need to determine if Excel is ready to accept a COM object from win32com in Python. For instance if a dialog box is open in excel, any call to a win32com function will cause a 'Call was rejected by callee' error.</p>
  
  <p>Through trial and error I have found that if Excel ( actaully I assume any Office product ) has a dialog box open, any call to win32com will result in an error.</p>
  
  <p>After quite a bit of googling I have found many questions about what amounts to self inflicted dialog boxes being open. i.e. doing a Excel.SaveAs() will open a dialog box on the sheet and you are stuck until the user closes it.</p>
  
  <p>In my case I have a user that has opened a dialog box or in some otherway has interacted with Excel and left it waiting for input. Something as simple a starting to enter a formula on the formula bar will cause the win32com function to return with an error.</p>
  
  <p>So couple of questions:
  Is there a way to determine if Excel is ready for a command?
  Is there a way to tell what box is open (what is excel waiting for?)
  Is there a way to close the box through win32com ... remember that as far as I can tell anything I do with win32com will return an error when it is in this state</p>
  
  <p>I know I could do a try: catch: but I would need that around every win32com function ( at this point there are a lot of them). I think that that approach would make the code unnecessarily long and complex.</p>