Kill Function will not delete the file

lnagel

Board Regular
Joined
May 28, 2018
Messages
117
Looks fairly simple - Code runs just like it knows what to do and then nothing

File resides on Desktop and .Fullname does return the correct path

Code:
tempFileName = targetWorkbook.FullName
    'MsgBox "Target Workbook Name = " & tempFileName
    targetWorkbook.Save
    targetWorkbook.Close
    Kill tempFileName

I have also tried to close the workbook using the workbooks.close method - same results

Ideas?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Spot ON! - I had a "SaveAs" that needed to be a "SaveCopyAs".... One of those couldnt see the forest cuz of the trees conundrums. Thanks so much RoryA
 
Upvote 0

Forum statistics

Threads
1,223,239
Messages
6,170,947
Members
452,368
Latest member
jayp2104

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top