Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub KillActive()
dim sName as String On Error Resume Next sName = ThisWorkbook.FullName Application.DisplayAlerts = False ThisWorkbook.ChangeFileAccess xlReadOnly Kill sName Application.DislayAlerts = True ThisWorkbook.Close SaveChanges:=False End Sub worked for me. -- Regards, Tom Ogilvy "Simon Lloyd " wrote in message ... Well i tried the code below, it does run the Killactive code but i get a pop up that asks me do i want to save changes before switching file types and whether you choose yes or no (i have tried displayalerts=false) the file closes but does not delete it self even if i put this code in the auto_open. Any thoughts??? Simon Sub Auto_close() Dim MyDate MyDate = #8/26/2004# If Date = MyDate Then Call KillActive End If End Sub Sub KillActive() On Error Resume Next demomatrix.xls = ActiveWorkbook.FullName ActiveWorkbook.ChangeFileAccess xlReadOnly Kill demomatrix.xls ActiveWorkbook.Close SaveChanges:=False End Sub --- Message posted from http://www.ExcelForum.com/ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
deleting workbook | New Users to Excel | |||
Deleting Workbook from others | Excel Worksheet Functions | |||
Deleting workbook | Excel Programming | |||
Deleting workbook | Excel Programming | |||
Deleting Workbook | Excel Programming |