Okay I think you helped me to learn something else.
Here's a good link for anyone reading this that wants to know about what the personal workbook is and how to set one up if you don't have one. I was right I didn't have a personal workbook now I do, thanks to Ron de Bruin, and I think you were right in your thoughts that maybe the personal workbook was the issue.
So first let me say I made a change to the code:
Needs to be changed to:
So I created the personal workbook and right away I figured the main problem is ThisWorkbook refers always to the workbook the code is in. Therefore the change to ActiveWorkbook.
I started by not changing the code to see what would happen. When I run it I notice the file name on my spreadsheet has not changed. In the VBE my personal file name has changed to what the code should have changed the file I was working on to. I go into the folder where the file should have been created and there is a file by that name in there, but when I click on it Excel crashes immediately. When I choose to open any other file except this file that crashes Excel, everything seems fine and when I go into the VBE my personal file is back in the project explorer and all seems fine.
So I opened one of my existing workbooks I had and found the macro in the personal macro list and ran it. The file I used is a .xlsm and you wanted yours saved as .xls so when the macro runs I get all this stuff about significant loss of functionality, but I just click continue. It seems okay. In the VBE the original file does not show only the new one I created and the personal file. I close the file there are no issues it doesn't ask if I want to save it and it doesn't crash. I go into the folder it was saved in and double click to open it and everything seems fine. Maybe something was lost because it was a .xlsm file, but I don't know what it is that is different. If I open a blank workbook add some data and run the macro I have no issues at all. It wasn't previously saved in a non xls format so I don't get a message about loss of functionality and when I close and reopen the file the data I entered is in tact.
So I hope you are going to make the change and tell me all is good.
Bookmarks