added code to auto-generate excel tables