Zum Hauptinhalt gehen

Suche

Suche

Bartender Text Save To Excel

Kommentare

2 Kommentare

  • Avatar
    Ian Cummings
    Moderator

    With a quick Google search on "VBS write to Excel file" I got the below example:

     

    Option Explicit
    Dim objExcel, strExcelPath, objSheet

    strExcelPath = "c:\Scripts\Example.xls"

    ' Open specified spreadsheet and select the first worksheet.
    Set objExcel = CreateObject("Excel.Application")
    objExcel.WorkBooks.Open strExcelPath
    Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)

    ' Modify a cell.
    objSheet.Cells(3, 2).Value = "Test"

    ' Add a row before row 5.
    objSheet.Range("B5").EntireRow.Insert

    ' Label the new rows. Row 4 is unchanged,
    ' but what was row 5 is now row 6.
    objSheet.Cells(4, 2).Value = "Row 4"
    objSheet.Cells(5, 2).Value = "Row 5"
    objSheet.Cells(6, 2).Value = "Row 6"

    ' Save and quit.
    objExcel.ActiveWorkbook.Save
    objExcel.ActiveWorkbook.Close
    objExcel.Application.Quit

    0
  • Avatar
    Legacy Poster

    thank you !! i will to test

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.