Thread: File kill help
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Marino13[_6_] Marino13[_6_] is offline
external usenet poster
 
Posts: 1
Default File kill help

The following code was written with the intent to:

1) make a copy of the active workbook, name it "PAPenguins"

2) unmap a network drive

3) delete the file "PAPenguins"

It is not working. Can someone please help!!!

Dim SaveCode
SaveCode = "V:\" & Range("g7") & "\" & Range("b4") & " wit
Comments.xls"
ActiveWorkbook.SaveAs Filename:=SaveCode, FileFormat _
:=xlNormal, password:="", WriteResPassword:=""
ReadOnlyRecommended _
:=False, CreateBackup:=False
Dim wb As Workbook
Set wb = ActiveWorkbook
With wb
.SaveAs "PAPenguins.xls"
Call Unmap
x = .FullName
.Close False
Kill x
End With
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "PAPenguins.xls"
x = .FullName
.Close False
Kill x
End Wit

--
Message posted from http://www.ExcelForum.com