Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports Excel = Microsoft.Office.Interop.Excel
- Imports Microsoft.Office
- Public Class Form8
- Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
- Dim appXL As Excel.Application = Nothing
- Dim wbXL As Excel.Workbook = Nothing
- Dim wbXLs As Excel.Workbooks = Nothing
- Dim shXL As Excel.Worksheet = Nothing
- Dim shXLs As Excel.Worksheets = Nothing
- Dim raXL As Excel.Range = Nothing
- appXL = New Excel.Application
- wbXL = appXL.Workbooks.Open("D:\fileExcel\Latihan100.xlsx")
- appXL.Visible = True
- shXL = wbXL.Worksheets("Sheet1")
- appXL.UserControl = True
- raXL = Nothing
- wbXL = Nothing
- shXL = Nothing
- appXL = Nothing
- Exit Sub
- Err_Handler:
- MsgBox(Err.Description, vbCritical, "Error: " & Err.Number)
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement