Permission Denied - Kill File - Workbook Open Event

rodrigofrb

New Member
Joined
Dec 4, 2011
Messages
4
Hi there Excel Masters,

My file contains a function to Delete & replace itself for its latest version.

This function can be accessed by a button on one of the sheets; or everytime I open the workbook.

This function works perfectly if I trigger it from the button on the sheets, but if it is triggered by the Workbook_Open event I get a Permission Denied error.

This same function has been working fine on Excel 2003 for a very long time, but my company recently started using a virtual client that has Excel 2010 in it. Since this change, the code started to give me headaches.

Even the simplest version of the code will still throw the same error, and I noticed it also happens for the FileCopy command.
Kill "Full Path"; or
FileCopy "OriginFolder/FileName", "DestFolder/FileName"

HAs anyone experienced this problem before? Any help would be much appreciated.

Thanks in advance and kind regards,

Rodrigo
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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