ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   File kill help (https://www.excelbanter.com/excel-programming/291869-file-kill-help.html)

Marino13[_6_]

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



All times are GMT +1. The time now is 09:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com