Advertisement
stevennathaniel

Source Code For Next Untuk MS Excel

Jan 26th, 2016
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.71 KB | None | 0 0
  1. Imports Excel = Microsoft.Office.Interop.Excel
  2.  
  3. Imports Microsoft.Office
  4.  
  5. Public Class Form6
  6.  
  7.     Dim appXL As Excel.Application = Nothing
  8.  
  9.     Dim wbXL As Excel.Workbook = Nothing
  10.  
  11.     Dim shXL As Excel.Worksheet = Nothing
  12.  
  13.     Dim raXL As Excel.Range = Nothing
  14.  
  15.     Dim i As Integer
  16.  
  17.  
  18.     Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
  19.  
  20.         appXL = New Excel.Application
  21.  
  22.         wbXL = appXL.Workbooks.Open("D:\fileExcel\Latihan100.xlsx")
  23.  
  24.         shXL = wbXL.Worksheets("Sheet2")
  25.  
  26.         shXL.Activate()
  27.  
  28.         appXL.Visible = True
  29.  
  30.         For i = 1 To 6
  31.  
  32.             shXL.Cells(i, 1) = 100
  33.         Next
  34.  
  35.  
  36.  
  37.     End Sub
  38. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement