Advertisement
stevennathaniel

Membuat Nilai Cell Excel Menjadi Bold

Jan 24th, 2016
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.88 KB | None | 0 0
  1. Imports Excel = Microsoft.Office.Interop.Excel
  2.  
  3. Imports Microsoft.Office
  4.  
  5.  
  6. Public Class Form2
  7.  
  8.     Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
  9.  
  10.         Dim appXL As Excel.Application = Nothing
  11.  
  12.         Dim wbXL As Excel.Workbook = Nothing
  13.  
  14.         Dim shXL As Excel.Worksheet = Nothing
  15.  
  16.         Dim raXL As Excel.Range = Nothing
  17.  
  18.         appXL = New Excel.Application
  19.  
  20.         wbXL = appXL.Workbooks.Open("D:\fileExcel\Latihan100.xlsx")
  21.  
  22.         shXL = wbXL.Sheets("Sheet1")
  23.  
  24.  
  25.         raXL = shXL.Range("A1")
  26.  
  27.         raXL.Font.Bold = True
  28.  
  29.  
  30.  
  31.         appXL.UserControl = True
  32.  
  33.         appXL.Visible = True
  34.  
  35.         raXL = Nothing
  36.  
  37.         wbXL = Nothing
  38.  
  39.         shXL = Nothing
  40.  
  41.         appXL = Nothing
  42.  
  43.         Exit Sub
  44.  
  45.  
  46. Err_Handler:
  47.  
  48.         MsgBox(Err.Description, vbCritical, )
  49.  
  50.  
  51.     End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement