vba does not find file even though it exists

rossbritton26

New Member
Joined
Jul 28, 2011
Messages
33
Hi,

I have some code which seemingly works fine. It takes a unique "ID" code from a list and then opens the file which begins with that "ID" code from a specified location.

This appears to work fine, except for one file. There appears to be no difference with the file name, extension, type or anything else when compared to all the other files which have worked!

The code is picking up the correct "ID", but then it just opens the first file in the folder instead of the required file.

Again, all other files have worked perfectly fine apart from this random one in the middle!!

Any ideas,

Ross.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Yeah, code would be useful, together with the corresponding file name, taken from explorer>right-click>properties
 
Upvote 0

Forum statistics

Threads
1,216,783
Messages
6,132,678
Members
449,747
Latest member
OldMrsMol

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