You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.6 KiB
47 lines
1.6 KiB
Public Class frmExcelSheets
|
|
Dim m_excelsheet As String
|
|
Property ExcelSheet() As String
|
|
Get
|
|
Return m_excelsheet
|
|
End Get
|
|
Set(ByVal value As String)
|
|
m_excelsheet = value
|
|
End Set
|
|
End Property
|
|
|
|
Dim m_excelfile As String
|
|
Property ExcelFile() As String
|
|
Get
|
|
Return m_excelfile
|
|
End Get
|
|
Set(ByVal value As String)
|
|
m_excelfile = value
|
|
End Set
|
|
End Property
|
|
Private Sub frmExcelSheets_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
|
|
|
Dim intxls As New Microsoft.Office.Interop.Excel.Application
|
|
intxls.Workbooks.Open(ExcelFile)
|
|
For Each s As Microsoft.Office.Interop.Excel.Worksheet In intxls.ActiveWorkbook.Sheets
|
|
Me.lstSheets.Items.Add(s.Name)
|
|
Next
|
|
intxls.ActiveWorkbook.Close(False)
|
|
intxls.Quit()
|
|
intxls = Nothing
|
|
End Sub
|
|
|
|
Private Sub BtnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOK.Click
|
|
Me.ExcelSheet = "[" & Me.lstSheets.SelectedItem & "$]"
|
|
Me.DialogResult = Windows.Forms.DialogResult.OK
|
|
Me.Close()
|
|
End Sub
|
|
|
|
Private Sub BtnAbbruch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnAbbruch.Click
|
|
Me.DialogResult = Windows.Forms.DialogResult.Cancel
|
|
Me.Close()
|
|
End Sub
|
|
|
|
Private Sub lstSheets_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstSheets.DoubleClick
|
|
BtnOK_Click(sender, e)
|
|
End Sub
|
|
End Class |