Sunday, September 16, 2012

simple tutorial how to : VB.net and excel connection Part 2

Lanjutan Part 1
Copy dan Paste Range

Copy Paste dalam satu sheet yang sama

Imports Excel = Microsoft.Office.Interop.Excel
Public Class Form1
    Dim xlApp As New Excel.Application
    Dim xlWorkBook As Excel.Workbook
    Dim xlWorkSheet As Excel.Worksheet
    Dim xlSourceRange, xlDestRange As Excel.Range

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        xlWorkBook = xlApp.Workbooks.Open("C:\vb dan excel\percobaan.xlsx") 
       xlApp.Visible = True

       xlWorkSheet = xlWorkBook.Sheets("Sheet1")

        '~~> sumber yg mau di copy
        xlSourceRange = xlWorkSheet.Range("A1:B10")

        '~~> tujuan atau mau dipaste
        xlDestRange = xlWorkSheet.Range("D1")

        '~~> Copy paste range
        xlSourceRange.Copy(xlDestRange)
    End Sub   
End Class


Copy Paste dalam satu workbook yang sama beda worksheet

simple tutorial how to : VB.net dan excel connection Part 1

Setting agar VB.Net bisa terkoneksi dengan excel
Pada project "Add reference" , masuk tabulasi "COM" lalu pilih Microsoft Excel Object Library
Masukan kode berikut sebelum Public (paling atas)


Imports Excel = Microsoft.Office.Interop.Excel

Membuat file excel baru
Berikut contohnya, dipasang pada button 1


Imports Excel = Microsoft.Office.Interop.Excel
Public Class Form1
'~~> mendefine object excel
Dim xlApp As New Excel.Application
Dim xlWorkBook As Excel.Workbook

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'~~> membuat WorkBook (file excel) baru
xlWorkBook = xlApp.Workbooks.Add

'~~> memumculkan file excel 
xlApp.Visible = True
End Sub
End Class


Membuka file excel

Saturday, September 15, 2012

simple tutorial how to : configure management bandwidth dengan queue tree PCQ


Langsung aja gan..
Asumsikan internetnya sudah jalan (settingan IP public, private dan NAT sudah)
saya kasih contekan konfigurasi management bandwidth dengan queue pcq, biar agan bisa langsung copas ke teminal nya mikrotik kalo menggunakan  IP yang nya sama..
Contohnya pake IP private 192.168.0.0/24 (ether2)
Gateway di mikrotik 192.168.0.254 (ether1)
ada 10 PC client dari IP 1 sampai 10
layanan 2Mbps
buat mangle nya dulu pada mikrotik untuk marking koneksi dan packet dari tiap PC client, contoh berikut IP PC client 192.168.0.1 sampai 192.168.0.10

simple tutorial how to : configure firewall mikrotik


langsung aja gan..
Sebenarnya ini sudah banyak sih artikel tentang configure firewall mikrotik, ane cuma mau share dan kalau ada yang mau menambahkan.
script nya di copas aja di terminal, firewall berikut untuk block port" yang sering di pake virus, dan juga akses ke mikrotik di batasi hanya untuk ip-ip di address-list aour network
Kita buat dulu address-list dgn nama ournetwork, diisi IP yang di ijinkan untuk akses mikrotik agan

Back to Blog

Lama ga nge-blog...
Baca-baca yg lama.. busyet..
Bertanya dalam hati: "Darimana dapat kata" itu??"

Lanjut ngeblog buat nulis yg sering kucari ulang, padahal dah pernah solved.. sekalian share..