Hale, Jim
jim.hale at fleetpride.com
Fri Aug 29 11:39:17 CDT 2003
I have an instance of Excel that I can't seem to kill except through the
task manager or shutting down Access. I can make the instance visible and
try to shut it down using exit off the file menu but it won't shut down that
way either. The code executes without error. The code is below. What am I
missing? TIA
Jim Hale
Public Function Load_History(intDept As Integer, strDeptname As String, _
intCo As Integer, strRegioncode As String, strRegionName As String, _
strAreacode As String, strDept2 As String, strPlGroup As String) As Boolean
dim appExcel As Excel.Application
Set appExcel = Excel.Application
........... tons of astounding code, yada,yada,yada
If strPW <> "none" Then 'set password
For i = 1 To .Sheets.Count
.Worksheets(i).Protect Password:=strPW
Next i
.Sheets("instruc").Unprotect Password:=strPW
.Sheets("assumptions").Unprotect Password:=strPW
End If
.ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
.ActiveWorkbook.Protect Structure:=True, Windows:=False,
Password:=strPWworkbook
.ActiveWorkbook.SaveAs FileName:=strFileSave
.ActiveWorkbook.Close SaveChanges:=True
End With
Load_History = True
The_End:
appExcel.Quit
Set appExcel = Nothing
dbs2.Close
Exit Function
Err_CreatePlan:
Load_History = False
MsgBox Err.Description
Resume The_End
End Function
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030829/66d17bcf/attachment.html>