Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 如何创建Excel文件的副本而不打开_Vb.net_Excel - Fatal编程技术网

Vb.net 如何创建Excel文件的副本而不打开

Vb.net 如何创建Excel文件的副本而不打开,vb.net,excel,Vb.net,Excel,在不使用打开Excel文件的情况下,创建Excel文件副本的命令是什么?file.copy 文件,复制 让我们以VB为中心:My.Computer.FileSystem.CopyFile让我们以VB为中心:My.Computer.FileSystem.CopyFile复制方法中的参数“true”表示覆盖任何现有文件,这样它就不会爆炸 Imports System.IO Module Module1 Sub Main() Dim originalFile As String

在不使用打开Excel文件的情况下,创建Excel文件副本的命令是什么?

file.copy

文件,复制


让我们以VB为中心:My.Computer.FileSystem.CopyFile

让我们以VB为中心:My.Computer.FileSystem.CopyFile

复制方法中的参数“true”表示覆盖任何现有文件,这样它就不会爆炸

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

copy方法中的parm'true'表示覆盖任何现有文件,这样它就不会爆炸

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

请详细解释一下。这个代码是做什么的?如何使用它来解决这个问题?请详细解释。这个代码是做什么的?如何用它来解决这个问题?