Simple Code to Call Excel Sheet from VB
Simple Code to Call Excel Sheet from VB
Rate Simple Code to Call Excel Sheet from VB
(1(1 Vote))
Dim objBook As Excel.Workbook
Dim objSheet As Excel.Worksheet
Dim fName As String
Set objExcel = New Excel.Application
'Another Method to create Excel Object
'Set objExcel = CreateObject("Excel.application")
fName = AppPath() + "Excel Example"
Set objBook = objExcel.Workbooks.Open(fName)
Set Sheet = objBook.Worksheets(1)
Sheet.Range("B8", "B18").Font.Bold = True 'To Set Bold Font
Sheet.Range("A1").Value = "This is A1 Cell"
Sheet.Range("B1").Value = "This is B1 Cell"
Sheet.Range("C1").Value = "This is C1 Cell"
Sheet.Range("D1").Value = "This is D1 Cell"
Sheet.Range("E1").Value = "This is E1 Cell"
objExcel.Visible = True
objExcel.UserControl = True
objExcel.Caption = "Excel Report Example"
objExcel.DisplayExcel4Menus = False
Simple Code to Call Excel Sheet from VB Comments
No comments yet — be the first to post one!
Post a Comment