• Export table to Excel (Acc 2K)

    Author
    Topic
    #401315

    Greetings,

    I

    Viewing 1 reply thread
    Author
    Replies
    • #789658

      You can use DoCmd.TransferSpreadsheet in the On Click code of a command button to export a table or query to Excel. For example:

      Private Sub cmdExport_Click()
      DoCmd.TransferSpreadsheet TransferType:=acExport, _
      SpreadsheetType:=acSpreadsheetTypeExcel9, _
      TableName:=”Name_of_Table_or_Query”, _
      FileName:=”C:ExcelExport.xls”, _
      HasFieldNames:=True
      End Sub

    • #789659

      You can use DoCmd.TransferSpreadsheet in the On Click code of a command button to export a table or query to Excel. For example:

      Private Sub cmdExport_Click()
      DoCmd.TransferSpreadsheet TransferType:=acExport, _
      SpreadsheetType:=acSpreadsheetTypeExcel9, _
      TableName:=”Name_of_Table_or_Query”, _
      FileName:=”C:ExcelExport.xls”, _
      HasFieldNames:=True
      End Sub

    Viewing 1 reply thread
    Reply To: Export table to Excel (Acc 2K)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: