What is the command to create a copy of a excel file without opening it using vb.net.
Can anyone helpe me out there....
Thank you.
What is the command to create a copy of a excel file without opening it using vb.net.
Can anyone helpe me out there....
Thank you.
File.Copy
http://msdn.microsoft.com/en-us/library/system.io.file.copy(VS.71).aspx
The parm 'true' in the copy method says to overwrite any existing file so it doesn't bomb out.
Imports System.IO
Module Module1
Sub Main()
Dim originalFile As String = "c:\work\myExcelFile.xls"
Dim copyOfOriginalFile As String = "c:\work\myExcelFileCopy.xls"
If File.Exists(originalFile) Then
System.IO.File.Copy(originalFile, copyOfOriginalFile, True)
Else
Console.WriteLine("{0} does not exist", originalFile)
End If
End Sub
End Module