ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Tell OS to refresh? (https://www.excelbanter.com/excel-programming/318331-tell-os-refresh.html)

quartz[_2_]

Tell OS to refresh?
 
Is there a way, say after a file has been renamed using code, to force the
operating system to refresh so that it recognizes the change in the file name?

Or do I need to pause my code for a few seconds to give it time to do this?

Thanks much in advance.

Tom Ogilvy

Tell OS to refresh?
 
A file is renamed by saving it with a new name. The OS shouldn't have to
refresh since part of saving it includes writing that information to the
directory.

What are you trying to do that is causing problems?

--
Regards,
Tom Ogilvy

"quartz" wrote in message
...
Is there a way, say after a file has been renamed using code, to force the
operating system to refresh so that it recognizes the change in the file

name?

Or do I need to pause my code for a few seconds to give it time to do

this?

Thanks much in advance.




quartz[_2_]

Tell OS to refresh?
 
I am working on a utility for users to re-organize large numbers of files. It
allows the user to select multiple files in a folder (using file picker). The
utility then prompts for a new name. The program loops through the array of
file names and changes the name of each file to the new name and appends a
new sequential number at the end.

I was getting an error indicating that a file with that name already exists,
even though the counter was incrementing, but I just found an error in my
code that fixed it.

Sorry - please disregard. Thanks for your time.

"Tom Ogilvy" wrote:

A file is renamed by saving it with a new name. The OS shouldn't have to
refresh since part of saving it includes writing that information to the
directory.

What are you trying to do that is causing problems?

--
Regards,
Tom Ogilvy

"quartz" wrote in message
...
Is there a way, say after a file has been renamed using code, to force the
operating system to refresh so that it recognizes the change in the file

name?

Or do I need to pause my code for a few seconds to give it time to do

this?

Thanks much in advance.






All times are GMT +1. The time now is 02:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com