Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VB Sample to write to EXCEL file
#1
VB Sample codes collection
write texts to excel file

Code:
        Dim APP As New Excel.Application
        Dim worksheet As Excel.Worksheet
        Dim workbook As Excel.Workbook
        workbook = APP.Workbooks.Open("D:\loadtest1.xlsx")
        worksheet = workbook.Worksheets("Sheet1")
        Dim iter1 As Integer

        For iter1 = 1 To 50
            'Add data to cells of the first worksheet in the new workbook
            worksheet.Cells(1, iter1).Value = D(iter1)

        Next
        'Save the Workbook and Quit Excel
        workbook.Save()
        workbook.Close()
        APP.Quit()
Reply
#1
VB Sample codes collection
write texts to excel file

Code:
        Dim APP As New Excel.Application
        Dim worksheet As Excel.Worksheet
        Dim workbook As Excel.Workbook
        workbook = APP.Workbooks.Open("D:\loadtest1.xlsx")
        worksheet = workbook.Worksheets("Sheet1")
        Dim iter1 As Integer

        For iter1 = 1 To 50
            'Add data to cells of the first worksheet in the new workbook
            worksheet.Cells(1, iter1).Value = D(iter1)

        Next
        'Save the Workbook and Quit Excel
        workbook.Save()
        workbook.Close()
        APP.Quit()
Reply
CAA


Forum Jump:


Users browsing this thread: 1 Guest(s)