D
Dave Bradshaw
I am using VBA to export a report from Access into Excel, reformatting
it so it looks something like the original report, and leaving the
Excel file open so that the user can email it.
My code goes something like:
DoCmd.OutputTo acOutputReport, strReport, acFormatXLS, _
stFullPath, False
Set myXLS = New Excel.Application
Set myWorkbook = myXLS.Workbooks.Open(strExcelFile)
- code to reformat the workbook (size columns and rows, add titles
etc) -
strFileName = stPath & "\Production Schedule " _
& DatePart("yyyy", Date) & "-" _
& DatePart("m", Date) & "-" & DatePart("d", Date)
myWorkbook.SaveAs (strFileName)
myXLS.Visible = True
Set myXLS = Nothing
This all works as required. But when the user closes Excel, the window
closes, but Excel is still listed as a running process.
it so it looks something like the original report, and leaving the
Excel file open so that the user can email it.
My code goes something like:
DoCmd.OutputTo acOutputReport, strReport, acFormatXLS, _
stFullPath, False
Set myXLS = New Excel.Application
Set myWorkbook = myXLS.Workbooks.Open(strExcelFile)
- code to reformat the workbook (size columns and rows, add titles
etc) -
strFileName = stPath & "\Production Schedule " _
& DatePart("yyyy", Date) & "-" _
& DatePart("m", Date) & "-" & DatePart("d", Date)
myWorkbook.SaveAs (strFileName)
myXLS.Visible = True
Set myXLS = Nothing
This all works as required. But when the user closes Excel, the window
closes, but Excel is still listed as a running process.