Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old October 24th 20, 05:25 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Oct 2020
Posts: 3
Default Identifying PERSONAL.XLSB macros

In my development environment, I make extensive use of a self developed library of useful macros (function or subroutine) that I maintain in PERSONAL.XLSB.

Is there any way I can get VBA to examine an application's code base and provide me with a list of PERSONAL.XLSB macros being called.

This is motivated by a problem I am anticipating in publishing a VBA application as an AddIn. I assume all PERSONAL.XLSB's macros being called by the application would have to be explicitly added to the AddIn code base.

Thank you

  #2   Report Post  
Old October 25th 20, 05:26 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Oct 2020
Posts: 3
Default Identifying PERSONAL.XLSB macros

On Saturday, October 24, 2020 at 12:25:44 PM UTC-4, wrote:
In my development environment, I make extensive use of a self developed library of useful macros (function or subroutine) that I maintain in PERSONAL.XLSB.

Is there any way I can get VBA to examine an application's code base and provide me with a list of PERSONAL.XLSB macros being called.

This is motivated by a problem I am anticipating in publishing a VBA application as an AddIn. I assume all PERSONAL.XLSB's macros being called by the application would have to be explicitly added to the AddIn code base.

Thank you


I have done some more investigations. It is easy to get a list of the procedures in PERSONAL.XLSB (or any workbook) using CodeModule methods (.ProcOfLines, .ProcCountLines). The same methods will provide an application's source code. By scanning through the source code and checking for the occurrence of any member of the PERSONAL.XLSB procedure list (using .Find or regular expressions) one should arrive at a list of the PERSONAL.XLSB procedures being called. These could then be programatically inserted into a new Module in the AddIn.

Of course there are details to be looked after. For instance the mention of a PERSONAL.XLSB procedure in a comment line needs to be ignored. Also, a PERSONAL.XLSB procedure may call another PERSONAL.XLSB procedure so a recursive check would need to be made.

But, it can be done. The main difficulty is that the Excel Object model does not provide direct support for procedures and one has to extract procedure information indirectly.
  #3   Report Post  
Old October 25th 20, 05:31 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2019
Posts: 72
Default Identifying PERSONAL.XLSB macros

" wrote in message
In my development environment, I make extensive use of a self developed
library of useful macros (function or subroutine) that I maintain in
PERSONAL.XLSB.

Is there any way I can get VBA to examine an application's code base and
provide me with a list of PERSONAL.XLSB macros being called.

This is motivated by a problem I am anticipating in publishing a VBA
application as an AddIn. I assume all PERSONAL.XLSB's macros being
called by the application would have to be explicitly added to the AddIn
code base.


What do you mean by "with a list of the macros being called". For example a
list of all Sub's in Personal.xlsb, or the routines called in personal
called by your adddin, or something else...?

Peter T


  #4   Report Post  
Old October 25th 20, 09:15 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Oct 2020
Posts: 3
Default Identifying PERSONAL.XLSB macros

On Sunday, October 25, 2020 at 12:31:39 PM UTC-4, Peter T wrote:
" wrote in message
In my development environment, I make extensive use of a self developed
library of useful macros (function or subroutine) that I maintain in
PERSONAL.XLSB.

Is there any way I can get VBA to examine an application's code base and
provide me with a list of PERSONAL.XLSB macros being called.

This is motivated by a problem I am anticipating in publishing a VBA
application as an AddIn. I assume all PERSONAL.XLSB's macros being
called by the application would have to be explicitly added to the AddIn
code base.

What do you mean by "with a list of the macros being called". For example a
list of all Sub's in Personal.xlsb, or the routines called in personal
called by your adddin, or something else...?

Peter T

My AddIn application will consist of a number of VBA procedures (function or subroutine). These may contain calls to another set of VBA procedures that reside in my PERSONAL.XLSB. And these directly called PERSONAL.XLSB procedures may also be calling other PERSONAL.XLSB procedures. Since my AddIn application will need to run on machines that do not have access to my PERSONAL.XLSB, the AddIn codebase will have to contain all the VBA code that may be called during application execution. That is why I am developing an application to identify the set of PERSONAL.XLSB procedures being used and copying them into a new module of my AddIn.
  #5   Report Post  
Old October 25th 20, 11:22 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2019
Posts: 72
Default Identifying PERSONAL.XLSB macros

" wrote in message
On Sunday, October 25, 2020 at 12:31:39 PM UTC-4, Peter T wrote:
" wrote in message
In my development environment, I make extensive use of a self developed
library of useful macros (function or subroutine) that I maintain in
PERSONAL.XLSB.

Is there any way I can get VBA to examine an application's code base and
provide me with a list of PERSONAL.XLSB macros being called.

This is motivated by a problem I am anticipating in publishing a VBA
application as an AddIn. I assume all PERSONAL.XLSB's macros being
called by the application would have to be explicitly added to the AddIn
code base.

What do you mean by "with a list of the macros being called". For example
a
list of all Sub's in Personal.xlsb, or the routines called in personal
called by your adddin, or something else...?

Peter T

My AddIn application will consist of a number of VBA procedures (function or
subroutine). These may contain calls to another set of VBA procedures that
reside in my PERSONAL.XLSB. And these directly called PERSONAL.XLSB
procedures may also be calling other PERSONAL.XLSB procedures. Since my
AddIn application will need to run on machines that do not have access to my
PERSONAL.XLSB, the AddIn codebase will have to contain all the VBA code that
may be called during application execution. That is why I am developing an
application to identify the set of PERSONAL.XLSB procedures being used and
copying them into a new module of my AddIn.


=========
There's nothing off the shelf I'm aware of. Various approaches, which would
be most efficient would depend on how many procedures potentially you need
to map, and how familiar you are with the VBA Extensibility object model (to
produce a listing of all the procedures in your personal and what procedures
they in turn might call.

If not dealing with many proc's maybe something simple like this might be
all you need -
Add the following to each proc in your personal -

Static bCalled As Boolean
If Not bCalled Then
Debug.Print "this proc name"
bCalled = True
End If

Run whatever it takes to ensure all proc's in your personal get called and
you should get a listing in the immediate window. With personal the active
project press the reset button to clear all the static variables.

You'd probably find 'MZ tools' useful if you don't already have it.

Peter T




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting personal.xlsb to personal.xls Walter Briscoe Excel Programming 9 January 5th 16 07:04 PM
UDF in PERSONAL.XLSB Faraz A. Qureshi Excel Programming 4 September 29th 09 02:34 PM
personal.xlsb dhstein Excel Discussion (Misc queries) 2 June 24th 09 11:20 AM
Deleting Macros in Personal XLSB file Kevin Excel Programming 3 May 22nd 09 09:21 PM
PERSONAL.XLSB LVS Excel Programming 1 October 22nd 08 04:12 AM


All times are GMT +1. The time now is 08:57 PM.

Powered by vBulletin® Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright 2004-2020 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"

 

Copyright © 2017