Hello all,
I have a module that deletes data in excel closes then Access imports then exports data to excel. When I try to run it a second time I get the following Error........runtime error '1004' Method 'Sheets' of object'_Global' failed.........i noticed that the Excel.exe stays active in Task Manager, is there a way form me to completely close out excel. Below is my code for the delete portion of my macro.
Function MW_Erase_DB_Results()
Dim appexcel As Object
Set appexcel = CreateObject("Excel.Application")
appexcel.Workbooks.Open "Z:\Call Aheads\Call_Ahead_Results\MW_Call_Ahead_Stats.xls"
appexcel.Visible = True
Sheets("DB_Results").Select
Cells.Select
Selection.Delete Shift:=xlUp
Range("A1").Select
Sheets("Projections").Select
Range("A4").Select
ActiveWorkbook.Save
ActiveWindow.Close
End Function
- - - - - - - - - - - -
thank you in advace!
E


Reply With Quote

Bookmarks