We use a very sophisticated Excel Spreadsheet to generate Order Confirmations, Invoicing and Delivery Notes. It is full of Macros so everything is automated and it takes out the human error but the only thing we can't control is saving the file as the wrong number so looking for a workround.
Typically we save files as:
'OC6027.pdf', 'OC6028.pdf', 'OC6029.pdf'... or 'IN6027.pdf', 'IN6028.pdf', 'IN6029.pdf'...
but nothing stopping the user accidentally putting 'OC6020' in the first spreadsheet as the next sequential number and then the current macros will copy across the error to the rest of the paperwork and just overwrite an existing file.
Is there a way to look into a folder (we only use 1 folder on the entire network) to check the last sequential file name and return it's value +1?
The only other alternative would possibly be to use If FileExist in the current Macro before saving
Can anybody give any guidelines?
Bookmarks