I have some code that creates and writes to a workbook from within MS Access..
The code does not save the workbook, so it opens as 'Book1.xls'.
I have found the problem line of code below... This sorts the data..
If this line is executed, then once the user closes Book1.xls there is still an instance of Excel running. However, if i comment this line then the Excel instance closes as expected.
Anyone have ideas how to fix this ?
Code
.Range(.Cells(3, 1), .Cells(500, 255)).Sort Key1:=Range("J3"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal
I have posted to another forum, but no response so far..