Losing the Com port when I want to re-load the sketch to Arduino.

Hi out there,
It puzzles me that my sketch can't be uploaded after a while when my Arduino has run.
What happens is this:
I upload the sketch and let the Arduino run for a while.
Meanwhile I open either the plotter or the monitor screen to see what happens.
But then, after closing the plotter or monitor screen and after making some alterations in the sketch, When I want to upload the new sketch I get the error:

avrdude: ser_open(): can't open device "\.\COM5": Het systeem kan het opgegeven bestand niet vinden.

(English: The system can't find the file...)

Please advice....

Thanks,
Jos

Did you connect anything to Arduino pin 0 or 1.
Leo..

Can you clarify whether it's the port or the file that's lost?