VB.net 2013 中的 EPPLus
EPPLus in VB .net 2013
您有在 VB.Net 2013 中使用 EPPlus 的示例吗?,因为我按照说明编写了一个应用程序,但它不起作用。这是代码:
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
这应该有效,除非文件路径错误,或者路径正确但没有名为 27 abril
的 sheet
您有在 VB.Net 2013 中使用 EPPlus 的示例吗?,因为我按照说明编写了一个应用程序,但它不起作用。这是代码:
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
这应该有效,除非文件路径错误,或者路径正确但没有名为 27 abril