Debug “Runtime error 76: path not found” in VBA Excel – debugvba.com

path not found error vba excel

Objective

To debug “Runtime error 76: path not found”.

Approach

In this post we have showcased the reason for “Path not found” error. This error is caused when we pass wrong path in mkdir, chdir, open or RmDir command. You can check the link in reference section for more details.

In the below shown image we can see how this error is shown, to simulate this error we had provided incorrect path in MyFolderName variable. When we executed the below shown code, this error was raised.

 

path not found error vba excel

 

To solve this error, we need use the correct path. One more tip, if we are opening a file using Open method, then we should check the file path, file name and we should also check the file extension properly. This is a very common error while opening a file.

 

Reference

https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/path-not-found-error-76

 

Post you may like

Debug Type Mismatch Error in VBA Excel