This is the macro I run via a button
I can save the file fine until I run the macro, then the program crashes when it auto saves or I save it.Please Login or Register to view this content.
Office 2013
Windows 8.1 Pro
This is the macro I run via a button
I can save the file fine until I run the macro, then the program crashes when it auto saves or I save it.Please Login or Register to view this content.
Office 2013
Windows 8.1 Pro
Last edited by FlooringSales; 08-18-2017 at 06:37 AM.
Hey, you're right. It crashes for me too, Office 2010 on Win7.
It creates and deletes the custom list correctly. I Googled "excel crashes after deleting custom list" and found this webpage: https://social.msdn.microsoft.com/Fo...e?forum=isvvba
The solution is to add another oWorksheet.Sort.SortFields.Clear after oRangeSort.Sort. This doesn't undo your sort, but it does clear the sorting criteria from the range, which is deleted after the macro. It was crashing because it couldn't find it.
I tried the new code and it works.
Design everything to be as simple as possible, but no simpler.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks