Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listing Files % Folders to a spreadsheet in EXCEL 2010 1

Status
Not open for further replies.

Walter349

Technical User
Aug 16, 2002
250
BE
Seems the code has changed in EXCEL 2010.

The fully functional code I have always used before in 2003 version, no longer works in 2010.

Does anyone have any idea how this works now with Excel 2010? Tried the 'Holy Book of Google' no luck strangely enough. Lots of references to the old method, very little on 2010 and nothing that helps.

An example would be useful from anyone that knows.



'If at first you don't succeed, then your hammer is below specifications'
 
I thuink we may need more info ...

Like: what fully functional code?
 
@strongm, can't you envision his code? You must be slipping! ;-)

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Sorry,

Not to have got back to this before now, but the issue got taken overtaken by other events. Solved the issue in another manner. But here's a thing.

I have this bit of code (Robbed from another author, don't know who) and I am trying to figure out how to include hyperlinking. so that the result builds a hyperlink on the spreadsheet.

Code:
    For Each f1 In fc
        Select Case Err
            Case 70  'Don't have access
                With Cells(R, 2)
                    .Value = "Access to this directory is denied"
                    .Font.ColorIndex = 3
                End With
                On Error GoTo 0
                Exit Sub
            Case 0  'Normal Access
                On Error GoTo 0
                R = R + 1
                With Cells(R, 1)
                    .Value = Folderspec(L)
                    .Font.ColorIndex = 15
                End With
                Cells(R, 2).Value = f1.Name
                Cells(R, 3).Value = f1.DateLastModified
                If IsCD Then
                Else
                    MaybeCD = True
                    Cells(R, 4).Value = f1.DateLastAccessed
                    MaybeCD = False
                End If
                Cells(R, 5).Value = f1.Size
            Case Else   'Not sure what this error would be
                Exit Sub
        End Select
        On Error Resume Next
    Next

Any ideas?

'If at first you don't succeed, then your hammer is below specifications'
 
Instead of

Cells(R, 2).Value = f1.Name

try

With Worksheets("<yoursheet>")
.Hyperlinks.Add Cells(R, 2), f1.path, , , f1.name
End With
 
Hey,

Worked like a dream, SkipVought always says I over think these things.

Many thanks

'If at first you don't succeed, then your hammer is below specifications'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top