I currently have a spreadsheet which every morning runs a macro. This used to run perfectly and quickly, but in the last month or so, it's started playing up during the saving phase and I don't know why.
To explain better, I should explain what the spreadsheet and macro do.
Basically, it is an excel spreadsheet which open on a PC that I remote desktop to that contains an Excel Table which links to our database every morning to refresh, this table shows our multiple clients with several lines per client. This works fine and dandy.
The aim of the macro is to create a separate work book for each client called by that client name. There are around 500 clients which makes in unmanageable to do manually and the clients are not always the same.
The macro creates a second table on sheet 2, and this table gives the first and last instance of the client name, this in turn helps identify which rows the macro copies and then pastes into a new workbook. The final part is to save the newly created workbook with the client name, then the loop kicks in and it continues to the next client until they are all done.
The problem itself as I said before is during the saving phase of the new workbook. For about 99% of the workbooks they save fine, but for about 3 or 4 whilst it’s saving, it hangs when you have the option to cancel the saving, (even though it has actually saved) and this stops the whole process. this only happens when using the VB script to open the spreadsheet and run the macro.
Without the problem this takes about 15-20 minutes, with the problem it takes until someone clicks cancel on the bit where it gets stuck.
Any help would be appreciated. (I have attached an example spreadsheet and the code below)
Bookmarks