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 cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Excel - Get Filename of every Excel SS across multiple instances

Status
Not open for further replies.

prudge

Mechanical
Joined
Dec 22, 2008
Messages
4
Location
CA
I need to get the filenames of all currently open workbooks in all instances of Excel. As well as change the focus to any open workbook in any of those instances.

I have tried almost everything and searched everywhere, but still have no solution.

For Each process In GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_process ")
If process.Name = "EXCEL.EXE" Then
activateapp(process)

This is about the closest I could find.

Any help would be great.
Thanks

 
You might post this over at Tek-tips.com - a sister to this website. Those guys are real programming geeks and know some stuff.
 
This will get all the workbook names in the current excel:
Sub getwbs()
Dim mywb As Workbook
For Each mywb In Workbooks
Debug.Print mywb.Name
Next mywb
End Sub

I agree Tek-tips is a good bet.

=====================================
(2B)+(2B)' ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top