Hi guys,
I just cant get this sucker worked out. I hope someone here can help me.
I want to export a query to excel which I have done. but I want to add formulas to the spreadsheet preferably at the end of the record I have just export.
for the cell I though something like this would be helpful but no avail
Excel.Range("A1").Select
Excel.ActiveCell.Formula = " Hi there"
This is waht i have so far
---------------------------
Dim db As DAO.Database
Dim qDef As DAO.QueryDef
Dim SQL As String
Set db = CurrentDb
SQL = "Select * from [monthly_sales_report]"
db.CreateQueryDef ([Forms]![monthly_report]![Month]), SQL
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, _
([Forms]![monthly_report]![Month]), "C:\3651H\Monthlysales2.xls", True
db.QueryDefs.Delete ([Forms]![monthly_report]![Month])
Set db = Nothing
-------------------------------------
Any help is much appreciated.
I just cant get this sucker worked out. I hope someone here can help me.
I want to export a query to excel which I have done. but I want to add formulas to the spreadsheet preferably at the end of the record I have just export.
for the cell I though something like this would be helpful but no avail
Excel.Range("A1").Select
Excel.ActiveCell.Formula = " Hi there"
This is waht i have so far
---------------------------
Dim db As DAO.Database
Dim qDef As DAO.QueryDef
Dim SQL As String
Set db = CurrentDb
SQL = "Select * from [monthly_sales_report]"
db.CreateQueryDef ([Forms]![monthly_report]![Month]), SQL
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, _
([Forms]![monthly_report]![Month]), "C:\3651H\Monthlysales2.xls", True
db.QueryDefs.Delete ([Forms]![monthly_report]![Month])
Set db = Nothing
-------------------------------------
Any help is much appreciated.