Elisha
03-11-2009, 01:40 PM
I have a qry in access that exports to excel spreadsheet but need to add vba that will also export the header / report title. This is what I have so far:
Public Sub ExportMSRXls()
Dim str_folder As String
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "MasterSalesRpt_ExportXLS", "M:\XS Sales\Reports\" & Format(Date, "mm.dd.yy") & Format(Time, " hh.mm") & " XS Master Sales Report.xls"
str_folder = "c:\XS Sales\Reports"
Call Shell("explorer.exe " & str_folder, vbNormalFocus)
This works fine, however, i need to add a header (report title) to the exported spreadsheet and am having trouble finding the right vba. I found this
Dim str_WS As Worksheet
Worksheet.PageSetup.CenterHeader = _
"Some&B&""Courier New""&10 Bold Courier New Size 10&B&""Arial"" Text"
but am having trouble incorporating what i have with this. I really really need help.
Public Sub ExportMSRXls()
Dim str_folder As String
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "MasterSalesRpt_ExportXLS", "M:\XS Sales\Reports\" & Format(Date, "mm.dd.yy") & Format(Time, " hh.mm") & " XS Master Sales Report.xls"
str_folder = "c:\XS Sales\Reports"
Call Shell("explorer.exe " & str_folder, vbNormalFocus)
This works fine, however, i need to add a header (report title) to the exported spreadsheet and am having trouble finding the right vba. I found this
Dim str_WS As Worksheet
Worksheet.PageSetup.CenterHeader = _
"Some&B&""Courier New""&10 Bold Courier New Size 10&B&""Arial"" Text"
but am having trouble incorporating what i have with this. I really really need help.