I have developed a macro excel in the book "A", I execute it calling it from another book the "B". In the book "B" I copy an excel sheet "data" that is generated in an Excel export process of a book "C" that contains the "data" sheet. If in the book "B" I create a new sheet called "data" and I copy in this sheet the cells of the data sheet of the book "C", the macro works well. However, if I copy the sheet "data" from the book "C" to the book "B" and execute the macro, the message appears
Error 91 occurred at run time: Object variable or block with not established
And the macro stops in the instruction
Worksheets("AVEVACons").AutoFilter.Sort.SortFields.Clear
Any suggestions? Thanks