def data_changed(old):
 data = xw.Range('A1').table.value
 df = pd.DataFrame(data[1:], columns=data[0])
 try:
  assert_frame_equal(df, old)
  return None
 except AssertionError:
  return df

def data_changed ( old ) : data = xw . Range ( 'A1' ) . table . value df = pd . DataFrame ( data [ 1 : ] , columns = data [ 0 ] ) try : assert_frame_equal ( df , old ) return None except AssertionError : return df
returns a new dataframe if data has changed on the excel workbook .