How do I control what RubberDuck does? #6236
-
I have recently downloaded and installed RubberDuck 2.5.9.6316. I have tried to get information of the internet but have not found it yet. RubberDuck (RD) seems to have scanned through all the MS Word templates on my PC (and took a while to do so). I want to use RD for just a specific code I am working on. I do not want RD to look at any other VBA routines already on my PC. Can you tell me how to restrict RD to the loaded code only? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 6 replies
-
Lock the projects you want RD to ignore. By design, Rubberduck parses and processes everything that's loaded in the VBE (if it's showing up in the VBE, it is code that's loaded in the process memory), but it will not be able to access the code from locked projects (it'll still grab all the information it can from any public members). The reason is because if you have projects A and B loaded, Rubberduck can't know which one you intend to be working on, or that you're not going to switch between them over time, and one may be referencing the other. But no, Rubberduck does not look for VBA code anywhere on your PC - only what's loaded in the VBE/host. If you have Word load 50 macro-enabled documents every time it opens, then yeah that makes 50 projects in the VBE, which is about 25 to 50 times the size of a workspace we'd typically be testing things with. If nothing ever changes in a loaded project, then Rubberduck will only parse it once. If it's referenced by another module that gets edited, then the references in project B to declarations in project A must be updated so navigation and refactorings will not mess anything up, so there's a resolver pass that'll happen even if the code isn't re-parsed. If projects reference any COM libraries, make sure they're actually used in the code, and remove any library reference that isn't: Rubberduck will generate tons of metadata for each library, that needs to be cached in memory so loading a large number of libraries without using them anywhere is wasting lots of resources that would otherwise be allocated elsewhere in the host process. I think the root problem is Word systematically loading all the templates in the first place, let alone any that's macro-enabled. |
Beta Was this translation helpful? Give feedback.
-
I would like to add that there is also an ignore project feature. I the settings you should be able to add projects you want RD to ignore although they are loaded in the VBE and not locked. |
Beta Was this translation helpful? Give feedback.
-
Ravi,
I suggest reading the RD Style Guide (
https://rubberduckvba.blog/2021/05/29/rubberduck-style-guide/) to get you
on a strong path to success with VBA, Giving things meaningful names is one
thing that seems trivial, but it most certainly is not. Renaming and
organizing into folders are a couple of things that RD makes easy to do.
Refactoring code is a breeze with RD.
SmileyFtW
…On Wed, Jan 8, 2025 at 12:44 PM RaviBanthia ***@***.***> wrote:
Thank you, retailcoder.
I understand what you are saying, and I understand the power RD has.
Unfortunately, the problem is that all the other Word templates (I have
inherited, collected, or built) are visible to RD.
Sorry for bothering you, but RD is going way beyond what I expected.
Perhaps I will have to move the other templates out of the standard
directories (such as Word's Startup folder).
That will be messy.
I am a newbie in VBA coding, and certainly did not realize the overheads I
was inadvertently invoking.
And as a newbie, I did not realize having all the templates using Module 1
would cause a mess, as I ran the macros individually from View>Macros.
I wonder if loading the current VBA code into Module 2 will help.
Though I realize the power of RD, I wish there was an option to tell RD to
work on only the code loaded in the current VB window.
I have quite some experience programming in FORTRAN, Clipper, C, and
AutoLISP, but that was in the DOS days.
I am tiring to make a comeback after many, many years.
Thanks for the great code you have written, and thanks for replying.
—
Reply to this email directly, view it on GitHub
<#6236 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKCD6F4TVD2NCJAZ3EADHQD2JVW2VAVCNFSM6AAAAABU2NWZ7WVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNZXG4ZDCMY>
.
You are receiving this because you are subscribed to this thread.Message
ID: <rubberduck-vba/Rubberduck/repo-discussions/6236/comments/11777213@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
If you are asking about RD, it is the VB version, not Word itself that
determines compatibility. A simple answer is All versions of Word (or any
of the MS Office Products) likely for you to use are compatible. That is
the beauty of RD's host-agnostic approach.
…On Wed, Jan 8, 2025 at 7:09 PM RaviBanthia ***@***.***> wrote:
BTW, what versions of MS Word is compatible with?
—
Reply to this email directly, view it on GitHub
<#6236 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKCD6F2AW6Y5R7KR2DKOLWT2JXD6JAVCNFSM6AAAAABU2NWZ7WVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNZYGEYDCMQ>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
I have a situation here, one that I have never encountered before. The last thing I remember doing on my PC was using the settings on RD. I was given some warning (probably by my system) that automatic scanning would be overridden. And RD had said a restart would be required. Now when I open any Word file, I get these errors: “The command cannot be performed because a dialog box is open. Click OK, and then close open dialog boxes to continue.” “The macro cannot be found or has been disabled because of your Macro security settings.” I have tried these:
None of these have solved the problem. Then I looked at the Add-ins. One Add-in has vanished from the ribbon. It is Graham Mayor’s BatchProcessDocuments Ver 4.7. BTW, I was not running that routine during or just before the problem arose. BTW, ChatGPT says: The issue lies with Word 2007, not the .NET Framework version. Here's why: Why Rubberduck Won't Work with Word 2007
|
Beta Was this translation helpful? Give feedback.
Thank you, retailcoder.
I understand what you are saying, and I understand the power RD has.
Unfortunately, the problem is that all the other Word templates (I have inherited, collected, or built) are visible to RD.
Sorry for bothering you, but RD is going way beyond what I expected.
Perhaps I will have to move the other templates out of the standard directories (such as Word's Startup folder).
That will be messy.
I am a newbie in VBA coding, and certainly did not realize the overheads I was inadvertently invoking.
And as a newbie, I did not realize having all the templates using Module 1 would cause a mess, as I ran the macros individually from View>Macros.
I wonder if loading the curren…