Results 1 to 6 of 6

Thread: VBA - lines of code/metric analysis?

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Posts
    3

    Exclamation VBA - lines of code/metric analysis?

    Hey all,
    I'm working with VBA .vbp files that are used in a third-party software package (i.e. not office). The third-party software package allows you to create custom rules, exports, manipulation, etc from a VBA standpoint.

    For each VBA project, there is only one file created that is simply .VBP. Does anyone know of any tools that can analyze these .VBP for lines-of-code, number of modules, and other metrics?

    Simply lines-of-code would be a good start, prefer something that is command-line oriented that has a consistent output to file or to screen that can be redirected to file.

    Thanky,
    -D

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: VBA - lines of code/metric analysis?

    Welcome to the Forums.

    VBA doesnt have vbp files. Visual Basic does. VBA is the IDE code editor
    behind most Office suite products.

    Are your vbp projects files with other related frm, frx, bas, cls files?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Posts
    3

    Re: VBA - lines of code/metric analysis?

    The editor shows both normal (.bas) modules and class modules that can either be created or imported, but the actual file saved is a single <project>.vbp file with no related .cls, .bas, or .frm, .frx files.

    I've talked to the thirdparty software provider, but they are more interested in the product then development support ;-)

    Now that you mentioned it, the editor does say 'visual basic 6.3', but is marketed/advertised as 'Visual Basic for Applications' to extend the existing platform.

    Sorry if I have posted to the incorrect forum. The single <project>.vbp file can not be loaded with VB6 or VisualStudio.NET, leaving me wondering where I should ask about this type of 'integrated vb for application' development environment.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: VBA - lines of code/metric analysis?

    No, I think its in the right place. VB 6.3 is actually VBA.

    What does this "Add-In" work with?

    Also, if its just the line count you need to get for starters then we could
    open the files as text files and read in the lines for counting.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Posts
    3

    Re: VBA - lines of code/metric analysis?

    I would rather avoid naming the thirdparty software, but it is workflow-related where you can exercise rules based on Events from within their software. These rules can be written in VBA, and I've been writing a lot and need to find a way to put metrics to these files.

    Attached hopefully is a sample file in zip format (which contains linetest.vbp). There should be visible the main class called 'ThisDocument', as well as a Module1 .bas and a Class1 .cls all within that single file.

    Like I mentioned, I'm stumped right now as to how to simply get lines-of-code out of these. I have 20 some-odd of these project files, so hopefully can locate an easy solution

    -D
    Attached Files Attached Files

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: VBA - lines of code/metric analysis?

    I cant open it, but I did use notepad. It looks like a Word Add-In. I cant do anything without the
    modules and classes. Sorry, I dont know what else to tell you other then see if the company has a
    support or user groups.

    I also suppose the vba project is unviewable from within Words VBA IDE?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

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



Click Here to Expand Forum to Full Width