Below is the current VBA to export the query to excel file but I need know how to export the formula from query like "avg=([m1]+[m2]+[m3])/3" to the excel file as well.
Private Sub Command34_Click()
Dim stDocName As String
DoCmd.SetWarnings Off
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "rpt_weeklystatus", "c:\rpt_weeklystatus.xlsx", True
Exit_Command34_Click:
Exit Sub
Err_Command34_Click:
MsgBox Err.description
Resume Exit_Command34_Click
End Sub
Private Sub Command34_Click()
Dim stDocName As String
DoCmd.SetWarnings Off
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "rpt_weeklystatus", "c:\rpt_weeklystatus.xlsx", True
Exit_Command34_Click:
Exit Sub
Err_Command34_Click:
MsgBox Err.description
Resume Exit_Command34_Click
End Sub