title: TypeError: 'bool' object is not callable in python, while saving the workbook
body: <p>I am trying to create a script where I first read a macro file, save it as a xlsx file and perform some tasks on it. Creating a subset dataframe from this excel file. After refreshing this excel again a subset dataframe is extracted and then these two distinct files with dataframes are compared.
  The script runs fine for the first time, but next time it shows the below error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;C:\Users\1234\AppData\Local\Programs\Python\Python38-32\Scripts\sell_triggers1.py&quot;, line 47, in &lt;module&gt;
      wb.Save()
  TypeError: 'bool' object is not callable
  </code></pre>
  <p>If I close all the excel instances from the windows task manager, then script will work fine.</p>
  <p>Please help where I am going wrong. I am very new to Python and can't figure out the issue. Thanks</p>
  <pre><code>import win32com.client
  import pandas as pd
  import os
  import smtplib
  import numpy as np
  import time
  
  excel = win32com.client.DispatchEx('Excel.Application')
  
  # Load the .XLSM file into Excel
  wb = excel.Workbooks.Open(r'D:\\MY DOCUMENTS\\WATCHLIST.xlsm')
  
  # Save it in .XLSX format to a different filename
  excel.DisplayAlerts = False
  wb.DoNotPromptForConvert = True
  wb.CheckCompatibility = False
  wb.SaveAs(r&quot;WATCHLIST1.xlsx&quot;, FileFormat=51, ConflictResolution=2)
  wb.Close(True)
  excel.Application.Quit()
  
  
  # Load the .XLSX file into Pandas
  df = pd.read_excel(&quot;C:\\Users\\1234\\Documents\\WATCHLIST1.xlsx&quot;, sheet_name='TRADES')
  
  df1 = df[[&quot;Ticker1&quot;,&quot;Current_price&quot;,&quot;Condition(Current_price&gt;STOP SMAW10)&quot;]].copy()
  
  df2 = df1[(df1[&quot;Condition(Current_price&gt;STOP SMAW10)&quot;] == 2)]
  
  df2.to_excel(&quot;watchlist2.xlsx&quot;, index= False)
  
  
  # refreshing the workbook and saving it
  
  xlapp = win32com.client.DispatchEx('Excel.Application')
  wb = xlapp.Workbooks.Open(r'C:\\Users\\1234\\Documents\\WATCHLIST1.xlsx')
  wb.RefreshAll()
  xlapp.CalculateUntilAsyncQueriesDone()
  xlapp.DisplayAlerts = False
  time.sleep(20)
  wb.Save()
  wb.Close(True)
  xlapp.Application.Quit()
  
   
  # again reading the watchlist and storing the filtered output to an excel file after refresh
  df = pd.read_excel(&quot;C:\\Users\\1234\\Documents\\WATCHLIST1.xlsx&quot;, sheet_name='TRADES')
  
  df1 = df[[&quot;Ticker1&quot;,&quot;Current_price&quot;,&quot;Condition(Current_price&gt;STOP SMAW10)&quot;]].copy()
  
  df2 = df1[(df1[&quot;Condition(Current_price&gt;STOP SMAW10)&quot;] == 2)]
  
  df2.to_excel(&quot;watchlist3.xlsx&quot;, index= False)
  
  # reading two different output files
  
  df1 = pd.read_excel(&quot;C:\\Users\\1234\\AppData\\Local\\Programs\\Python\\Python38-32\\Scripts\\watchlist2.xlsx&quot;)
  df2 = pd.read_excel(&quot;C:\\Users\\1234\\AppData\\Local\\Programs\\Python\\Python38-32\\Scripts\\watchlist3.xlsx&quot;)
  
  # preparing a comparison output
  
  df1 = df1.set_index('Ticker1')
  df2 = df2.set_index('Ticker1')
  
  df3 = pd.concat([df1,df2],sort=False)
  df3a = df3.stack().groupby(level=[0,1]).unique().unstack(1).copy()
  
  df3a.loc[~df3a.index.isin(df2.index),'status'] = 'deleted' # if not in df2 index then deleted
  df3a.loc[~df3a.index.isin(df1.index),'status'] = 'new'     # if not in df1 index then new
  idx = df3.stack().groupby(level=[0,1]).nunique() # get modified cells. 
  df3a.loc[idx.mask(idx &lt;= 1).dropna().index.get_level_values(0),'status'] = 'modified'
  df3a['status'] = df3a['status'].fillna('same') # assume that anything not fufilled by above rules is the same.
  
  # Create a Pandas Excel writer using XlsxWriter as the engine.
  writer = pd.ExcelWriter('./watchlist4.xlsx', engine='xlsxwriter')
  
  # Write each dataframe to a different worksheet.
  df3a.to_excel(writer, sheet_name='Data')
  
  # set column width for 'Data'. 
  worksheet = writer.sheets['Data']
  worksheet.set_column(0, 2, 15)
  
  # Close the Pandas Excel writer and output the Excel file.
  writer.save()
  </code></pre>