-
Hi,
I need to move a file from one location to another location, through vb. If the file already exists in the target location, I should not get the windows message saying "Overwrite - Yes or no".
Hope i could make it clear. Is it possible to suppress this message and overwrite the file without asking?
Please help me with some codes.
Venkat.
-
use FileCopy
------------------
Mark Sreeves
Analyst Programmer
[email protected]
A BMW Group Company
-
Hi Venkat
U can creat filesystemobject using vbscripting object. by using this u can move file from one place to other plaec easily....yes it will gv u error when replacing files but it has functions whihc u can use to check for the Presence of file at the destination.
revert if u need any more help
Thanx Manish
-
Hi Thanx to both of you..Can manish or mark provide me wiht some codes??
Thanx anyway
Venkat.
:-)
-
I am not sure with VB6, but with VBA you can override the alert message by writing application.display.alert =false.
However, as the default is = true, you need to reset it programatically right after the file replace, otherwise you will not see any other alerts.
VBA does not reset that property automatically.
------------------
Paul Stermann
DSI-Houston
-
This is from the VB Help Files.
Code:
Dim SourceFile, DestinationFile
SourceFile = "SRCFILE" ' Define source file name.
DestinationFile = "DESTFILE" ' Define target file name.
FileCopy SourceFile, DestinationFile ' Copy source to target.
-
Hi Thanks Guys, It worked well..
Regards,
Venkat.
:-)