Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi again..
I need more help. Sorry! When the workbook is opened ( 1 sheet called VT) its saved back to the original location with a new report number, and then saved to a temp folder where it is while the user work on it. After the user is finished the sheet is duplicated to a new workbook in a new location. Everything is ok with that, but then i want to delete the workbook that is in the temp folder by the macro in that workbook. The temp location is: FileSaveName = ActiveWorkbook.Path FileSaveNameEnd = FileSaveName & "\Arkiv\" varName = ActiveSheet.Name varDir = FileSaveNameEnd varYear = Format(Date, "yyyy") varNr = ReportNumber On Error GoTo xlErrorHandler: ActiveSheet.SaveAs Filename:=varDir & varName & varNr & varYear at the end of the sub i have this code: Kill "varDir & varName & varNr & varYear" End Sub Is it possible to "kill" the workbook while its still running or should i "kill" it from another location (program)? Michael -- Nil Satis Nisi Optimum |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Michael,
Try this Sub Michael() FileSaveName = ActiveWorkbook.Path FileSaveNameEnd = FileSaveName & "\Arkiv\" varName = ActiveSheet.Name varDir = FileSaveNameEnd varYear = Format(Date, "yyyy") varNr = ReportNumber ActiveSheet.SaveAs Filename:=varDir & varName & varNr & varYear With ActiveWorkbook If .Path < "" Then .Saved = True .ChangeFileAccess xlReadOnly Kill ActiveWorkbook.FullName End If End With End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Michael" wrote in message ... Hi again.. I need more help. Sorry! When the workbook is opened ( 1 sheet called VT) its saved back to the original location with a new report number, and then saved to a temp folder where it is while the user work on it. After the user is finished the sheet is duplicated to a new workbook in a new location. Everything is ok with that, but then i want to delete the workbook that is in the temp folder by the macro in that workbook. The temp location is: FileSaveName = ActiveWorkbook.Path FileSaveNameEnd = FileSaveName & "\Arkiv\" varName = ActiveSheet.Name varDir = FileSaveNameEnd varYear = Format(Date, "yyyy") varNr = ReportNumber On Error GoTo xlErrorHandler: ActiveSheet.SaveAs Filename:=varDir & varName & varNr & varYear at the end of the sub i have this code: Kill "varDir & varName & varNr & varYear" End Sub Is it possible to "kill" the workbook while its still running or should i "kill" it from another location (program)? Michael -- Nil Satis Nisi Optimum |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Bob.
Thank's again. You helped me a lot, again:-) It works just like i hoped, nice. Michael -- Nil Satis Nisi Optimum "Bob Phillips" wrote: Hi Michael, Try this Sub Michael() FileSaveName = ActiveWorkbook.Path FileSaveNameEnd = FileSaveName & "\Arkiv\" varName = ActiveSheet.Name varDir = FileSaveNameEnd varYear = Format(Date, "yyyy") varNr = ReportNumber ActiveSheet.SaveAs Filename:=varDir & varName & varNr & varYear With ActiveWorkbook If .Path < "" Then .Saved = True .ChangeFileAccess xlReadOnly Kill ActiveWorkbook.FullName End If End With End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Michael" wrote in message ... Hi again.. I need more help. Sorry! When the workbook is opened ( 1 sheet called VT) its saved back to the original location with a new report number, and then saved to a temp folder where it is while the user work on it. After the user is finished the sheet is duplicated to a new workbook in a new location. Everything is ok with that, but then i want to delete the workbook that is in the temp folder by the macro in that workbook. The temp location is: FileSaveName = ActiveWorkbook.Path FileSaveNameEnd = FileSaveName & "\Arkiv\" varName = ActiveSheet.Name varDir = FileSaveNameEnd varYear = Format(Date, "yyyy") varNr = ReportNumber On Error GoTo xlErrorHandler: ActiveSheet.SaveAs Filename:=varDir & varName & varNr & varYear at the end of the sub i have this code: Kill "varDir & varName & varNr & varYear" End Sub Is it possible to "kill" the workbook while its still running or should i "kill" it from another location (program)? Michael -- Nil Satis Nisi Optimum |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
'Kill' | Excel Programming | |||
File kill help | Excel Programming | |||
Kill Command | Excel Programming | |||
kill worksheets | Excel Programming | |||
AutoFill KILL | Excel Programming |