Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    44

    Unanswered: append current record to Excel

    How can I append the current record in a form to an existing Excel spreadsheet?

  2. #2
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    to do this via code add the excel reference
    Open the workbook and add the forms values to various ranges within excel
    without more detail this is abt all i can suggest

    as a very quick example
    Code:
    Sub passtoXl()
        Dim xlApp As Excel.Application
        Dim xlbook As Excel.Workbook
        Dim xlSheet As Excel.Worksheet
        Dim xlRange As Excel.Range
        
        Set xlApp = New Excel.Application
        Set xlbook = Workbooks.Add
        Set xlSheet = xlbook.Worksheets("Sheet1")
        Set xlRange = xlSheet.Range("A1")
        
        xlRange.Value = 2
        
        xlApp.Visible = True
        xlApp.UserControl = True
    
        
        Set xlApp = Nothing
        Set xlbook = Nothing
        Set xlSheet = Nothing
        Set xlRange = Nothing
    End Sub
    HTH

    Dave

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •