.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Sandeep Singh
Melody Anderson
Eminent IT

Home >> Code Snippets >> File Operation >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Create Excel in Run Time in VB.NET

Posted By:Santosh       Posted Date: November 10, 2009    Points: 10    Category: File Operation    URL: http://www.dotnetspark.com  

Below Code will Help you to Create Excel Sheet in Run Time in VB.NET.


       Dim xlApp As Excel.Application
        Dim xlWorkBook As Excel.Workbook
        Dim xlWorkSheet As Excel.Worksheet
        Dim range As Excel.Range
        Dim misValue As Object = System.Reflection.Missing.Value
        xlApp = New Excel.ApplicationClass
        xlWorkBook = xlApp.Workbooks.Add(misValue)
        xlWorkSheet = xlWorkBook.Sheets("sheet1")
        xlWorkSheet.Cells.Font.ColorIndex = 3
        xlWorkSheet.Cells.Font.Bold = True
        xlWorkSheet.Cells(2, 1) = "Screen Name"    'Report Header
        xlWorkSheet.Cells(2, 2) = "Error Description" 'Report Header

        xlWorkSheet.Cells(2, 3) = "Developer Name" 'Report Header
        xlWorkSheet.Cells(2, 4) = "Tester Name"    'Report Header
        xlWorkSheet.Cells(2, 5) = "Tester Name"      'Report Header
        xlWorkSheet.Cells(1, 5) = "Creating Excel Sheet"
        range = xlWorkSheet.Range("b1", " e1")
        xlApp.Visible = True



Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend