Get the list of all open file in vba

mehidy1437

Active Member
Joined
Nov 15, 2019
Messages
348
Office Version
  1. 365
  2. 2016
  3. 2013
Platform
  1. Windows
  2. Mobile
  3. Web
Hi guys,

How to get the list of all open file in excel using VBA? Which are currently open.
Open file can be any file, it can be image, dox, pdf, xlsx, ai etc.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
VBA Code:
Option Explicit

Sub ListWorkbooks()
    Dim wb As Workbook
    Dim ws As Worksheet
    Dim i As Single, j As Single
    Set ws = Sheets.Add
    For j = 1 To Workbooks.Count
        Range("A1").Cells(j, 1) = Workbooks(j).Name
        For i = 1 To Workbooks(j).Sheets.Count
            Range("A1").Cells(j, i + 1) = Workbooks(j).Sheets(i).Name
        Next i
    Next j
End Sub
 
Upvote 0
Thanks for your help, it just give me the details of excel file details.
Actually I'm looking for others file details also.

Like I have one PDF, JPG & DOC opened currently, but it don't give me the details of those file.
Is it possible to get the details of those file in excel cell or not?
 
Upvote 0

Forum statistics

Threads
1,214,431
Messages
6,119,462
Members
448,899
Latest member
maplemeadows

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