List of existing files

Hatye

Board Regular
Joined
Jan 11, 2010
Messages
143
Hi,

I would like to list all files in a specified folder. The files are placed in the following folder: "\\nodc01\ssa\Utstyr\Dokumenter\" & Me.Internnr" so that it will show different file content depending on what's selected/opened.
I have inserted a list and added this code (found here: Access/VBA Tutorials - List files recursively) to an event procedure:

Code:
Private Sub FilListe_Enter()

Dim strURL As String
strURL = "\\nodc01\ssa\Utstyr\Dokumenter\" & Me.Internnr


Call ListFiles(strURL, , , Me.FilListe)


End Sub

...but it doesn't work!
The error code says "Compile error: Sub or Function not defined".

Can anyone please help me with this?
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Did you add the ListFiles function code from that link to?
Otherwise, you are trying to call something which does not exist!
 
Upvote 0
Did you add the ListFiles function code from that link to?
Otherwise, you are trying to call something which does not exist!

Hi and thank you for your reply!

Yes, but I had made some stupid mistakes in some of the paths..

I have two other questions I hope that you or anyone else can help me with:
* Is it possible to hide the path of the file, so that only the file name is shown?
* Is there a way to open files in this list? It is not possible by double clicking, and when I right click the files, it is only copy, cut, paste and so on that are shown..
 
Upvote 0

Forum statistics

Threads
1,216,773
Messages
6,132,628
Members
449,740
Latest member
tinkdrummer

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