A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Dear @Paige Nix,
Thank you for reaching out Q&A Forum!
Based on our research, you are having trouble with Error#1004 in Excel. The error occurs because Visual Basic creates a reference to Excel when calling an object, method, or property without qualifying the element with Excel object variable. This reference isn’t released until the program ends, which can cause issues when the automation code runs multiple times.
To resolve this issue, please modify the code to be more specific before execution, with each call to an Excel object, method, or property.
Please visit the link for more information: Excel automation fails second time code runs - Microsoft Support
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.