Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-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
Dec 22, 2008
4
0
0
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

 
Replies continue below

Recommended for you

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.
Back
Top