List files from a folder that contain links to other files

fudgel

New Member
Joined
Jun 4, 2023
Messages
11
Office Version
  1. 2003 or older
Platform
  1. Windows
I have been tasked with moving files/folders from legacy (G:Drive) to SharePoint. A lot of excel files contain links to other excel files. Is there any way I can create a list of which files contain links within a folder? Rather than going into each file individually? Can a file be recognised as containing links without opening?
 
It has created the tabs and the headers, and downloads one excel workbook, then errors
I've worked out the error. I had left the \ off the end of the file path. :) After running, it comes up with a different error message
It has created the tabs and the headers, along with path, workbook, cell count = 0 for all, and nothing in the linkslist tab (apart from headers)
 

Attachments

  • error object required.PNG
    error object required.PNG
    20 KB · Views: 5
  • rngCell.PNG
    rngCell.PNG
    24.2 KB · Views: 4
Upvote 0

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Put this line:

MsgBox rngIncFormula.Address

under this line:

If Not rngIncFormula Is Nothing Then

Can you post a screen shot of the message box that comes up.
 
Upvote 0
Put this line:

MsgBox rngIncFormula.Address

under this line:

If Not rngIncFormula Is Nothing Then

Look at the first cell in the range list and post the formula.
So, after adding this, it was coming up with errors like attached (listing absolute cells), which I couldn't x out of, or close. I have entered a filepath where I know there is a workbook with a link, and the following error and debug came up.

It has created the tabs, and headers, (opened the workbook) but not listed in the tab.
 

Attachments

  • excel absolutes.PNG
    excel absolutes.PNG
    8.6 KB · Views: 4
  • invalid procedure.PNG
    invalid procedure.PNG
    8.6 KB · Views: 2
  • debug.PNG
    debug.PNG
    27.4 KB · Views: 3
Upvote 0
All the hightlighted code does is write out each row in the LinksList worksheet.
It uses standard Excel functions that have been around for ages.

I'd like to look at the formula's that you have in the cells.

What happens if you comment those lines out?

Does the code proceed without error?

Replace the lines with Wslist.Cells(lngRow, 1).value = objFile

What is the formula in call A3?

I've got to go out now for a short while.
 
Upvote 0
All the hightlighted code does is write out each row in the LinksList worksheet.
It uses standard Excel functions that have been around for ages.

I'd like to look at the formula's that you have in the cells.

What happens if you comment those lines out?

Does the code proceed without error?

Replace the lines with Wslist.Cells(lngRow, 1).value = objFile

What is the formula in call A3?

I've got to go out now for a short while.
Some success today! I have replaced the lines:

Wslist.Cells(lngRow, 1).Resize(1, 7).Value = Array(objFile, _
Ws.Name, _
rngCell.Address, _
Replace(Mid(rngCell.Formula, 2), ")", "", 1), _
Replace(Left(arr(1), InStr(1, arr(1), "]", vbTextCompare) - 1), "[", "", 1), _
Mid(arr(1), InStr(1, arr(1), "]", vbTextCompare) + 1), _
Replace(Mid(arr(2), 2), ")", "", 1))

With: Wslist.Cells(IngRow, 1).value = objFile

Comes up with run-time error '424' Object required.

However: It completes the WorkbooksList worksheet - has all the info added into the columns ie: Path, Workbook, Cell Count
Adds the worksheet for LinksList and all headers, but only has entries in the first column (Location), all other columns empty.

Debug line is as attached.
 

Attachments

  • Picture1.png
    Picture1.png
    29.4 KB · Views: 1
Upvote 0
Some success today! I have replaced the lines:

Wslist.Cells(lngRow, 1).Resize(1, 7).Value = Array(objFile, _
Ws.Name, _
rngCell.Address, _
Replace(Mid(rngCell.Formula, 2), ")", "", 1), _
Replace(Left(arr(1), InStr(1, arr(1), "]", vbTextCompare) - 1), "[", "", 1), _
Mid(arr(1), InStr(1, arr(1), "]", vbTextCompare) + 1), _
Replace(Mid(arr(2), 2), ")", "", 1))

With: Wslist.Cells(IngRow, 1).value = objFile

Comes up with run-time error '424' Object required.

However: It completes the WorkbooksList worksheet - has all the info added into the columns ie: Path, Workbook, Cell Count
Adds the worksheet for LinksList and all headers, but only has entries in the first column (Location), all other columns empty.

Debug line is as attached.

Hi Herakles

Thank you for spending time on this with me, it is really appreciated.
Is there anything else you could think of that would get this to work? Also, is it possible to extract a full list of G Drive, instead of each individual folder?
 
Upvote 0
Hi Herakles

Thank you for spending time on this with me, it is really appreciated.
Is there anything else you could think of that would get this to work? Also, is it possible to extract a full list of G Drive, instead of each individual folder?
 
Upvote 0

Forum statistics

Threads
1,215,133
Messages
6,123,235
Members
449,092
Latest member
SCleaveland

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