+ Reply to Thread
Results 1 to 6 of 6

How to get VBProject Workbook Name

  1. #1
    Registered User
    Join Date
    03-01-2012
    Location
    Suffolk, UK
    MS-Off Ver
    Excel 2010
    Posts
    7

    How to get VBProject Workbook Name

    Hi
    Could anyone help me determine what workbook a VBProject belongs to please?

    I've commented out Workbook.Name: that property doesn't exist but demonstrates what I want to find:

    Please Login or Register  to view this content.
    I know I can loop through the workbooks collection but I'm trying to get a list of all the installed addins. The workbook collection ignores addins.

    If I loop throught the Addins collection instead, testing the Installed property, it takes several seconds to finish the small loop: a noticable delay to my end users.

    Looping through the VBProjects seems the fastest way to check ALL open workbooks, whether an add-in or not.

    Anyone able to help?

    Thanks,
    Sam

  2. #2
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: How to get VBProject Workbook Name

    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    will give you the workbook name.
    Last edited by xlbiznes; 01-22-2014 at 12:58 PM.
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  3. #3
    Registered User
    Join Date
    03-01-2012
    Location
    Suffolk, UK
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: How to get VBProject Workbook Name

    Thanks Xlbiznes, but that's not quite what I'm after. I want to get the workbook names of ALL the open VBProjects within the current Excel Application, not just ThisWorkbook or ActiveWorkbook.

    Once I've got ALL the workbooks I can test their IsAddIn properties to continue my program.

  4. #4
    Forum Contributor
    Join Date
    12-14-2013
    Location
    Tilburg, Nederland
    MS-Off Ver
    Excel 2010
    Posts
    256

    Re: How to get VBProject Workbook Name

    Maybe this can help!

    Please Login or Register  to view this content.
    Gerard

  5. #5
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: How to get VBProject Workbook Name

    oops, i got it wrong.

    try this code :

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    03-01-2012
    Location
    Suffolk, UK
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: How to get VBProject Workbook Name

    OK thanks xlbiznes - you've prodded me towards the solution.
    I've realised I wasn't clear enough when detailing what I was after in my original post. I wanted to get the workbook name of every VB Project currently open, whether an add-in or not. The workbooks collection ignores add-ins, so no use. Looping through the add-ins collection takes a noticably long time, so no use.

    The solution was to loop through the VB Projects and exract the workbook name from the Filename property. This tests all workbooks, whether add-in or not, and also loops quickly. Problem solved.




    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How do get vbProject or workbook for a codepane?
    By foxguy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-23-2012, 01:08 PM
  2. VBProject locking
    By Aad van Straten in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-28-2011, 09:44 AM
  3. Unlock VBProject at runtime
    By MattShoreson in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-01-2008, 09:17 AM
  4. Password at VbProject
    By Syed Haider Ali in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-16-2006, 11:19 AM
  5. Does anyone know how to unprotect a VBProject using VBA code?
    By spacecityguy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-17-2005, 03:58 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1