I wrote a code which exports an access table to excel and then manipulates it.
it works OK, but leaves an EXCEL.EXE line in the task bar...
what am I doing wrong?
Thanks in advance,
Izhar
it works OK, but leaves an EXCEL.EXE line in the task bar...
what am I doing wrong?
Code:
Sub PrepareExcel(FileNme As String)
Dim xlWb As Excel.Workbook
Dim xlSh As Excel.Worksheet
Dim Rng As Range
Dim LastRow As Long
Dim LastCol As String
Dim LastCell As String
Set xlWb = Workbooks.Open(CurrentProject.Path & "\Exports\" & FileNme & ".xls")
Set xlSh = xlWb.Worksheets(FileNme)
Set Rng = xlSh.Cells
code
.
.
.
Finish:
xlWb.Application.DisplayAlerts = False
xlWb.Save
xlWb.Application.DisplayAlerts = True
xlWb.Close ' doesn't really close anything...
Set xlSh = Nothing
Set Rng = Nothing
Set xlWb = Nothing
End Sub
Izhar
Comment