View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
NickHK[_3_] NickHK[_3_] is offline
external usenet poster
 
Posts: 415
Default Excel crashes with long file names


"Confuscious" ...
Hi Jan

Thanks for that.

I'd already thought of that one but hadn't included it in the original
post.
It will probably be the simplest solution though so I'll probably go with
it
anyway.

Confuscious

"Jan Karel Pieterse" wrote:

Hi Confuscious,

Apart from the obvious of shortening the
directory or file names, does anyone know how to stop this happening?


Delete the file you're overwriting first:

On error resume next 'In case file is not there
Kill "c:\YaddaYadda.xls"
Activeworkbook.SaveAs "c:\YaddaYadda.xls"

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com
Member of:
Professional Office Developer Association
www.proofficedev.com