-2
您是否有過如何在VB.Net 2013中使用EPPlus的例子?,因爲我按照說明書編寫了一個應用程序,它不起作用。這是代碼:EPPLus in VB .net 2013
Imports System Imports System.IO
Imports officeopenxml
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Try
Dim NewFile As FileInfo = New FileInfo(My.Application.Info.DirectoryPath & "\control room abril.xlsx")
Dim NewTemplate = New FileInfo(My.Application.Info.DirectoryPath & "\control room abril.xlsx")
Dim XlPackage = New OfficeOpenXml.ExcelPackage(NewFile)
Dim sheetDatos = XlPackage.Workbook.Worksheets("27 abril")
Dim archivo As String
archivo = sheetDatos.Cells(5, 2).Value
MessageBox.Show(archivo)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
End Class
請解釋它是如何工作不表。你會得到一個編譯錯誤(如果是這樣,什麼錯誤在哪一行)?你會得到一個運行時異常(如果是這樣,哪條線上有什麼異常)? – Blackwood