Closed JauntyJJS closed 2 years ago
If I am not mistaken, the current Logo is based on a vector graphic I originally based off of the initial logo, ie. it is licensed under GPL, just like the software. As such you're welcome to use it :)
Thanks for the write-up, and for asking here!
This bit stuck out for me:
However, unlike the first method, this method is unable to export the cls files.
But, it does... It even exports the document modules such as ThisWorkbook
and worksheet modules (using a custom .doccls extension); the inherent limitation is that .doccls modules cannot be imported back into the project directly (because the host app /Excel owns these module, not the VBA project), but 'export active project' literally exports everything into a file system folder.
Rubberduck also has functionality to synchronize project content with the files in a folder, which is particularly useful for source control, see this article.
A note about documentation: Rubberduck can synchronize @Description "text here"
annotation comments with the actual COM docstring for a procedure (use @ModuleDescription
for module-level docs), which shows up in the VBE's own object browser and Rubberduck's Code Explorer and toolbar (as per the current selection!). It's just a small string value so nothing as extensive as the xmldoc-like features you're showing, but it integrates much better with the IDE and tooling, without cranking up the green-to-blue ratio in your code files too much.
Cheers!
Hi all,
Thank you for your prompt reply and fruitful feedback.
With regards to the exporting .doccls document, apologies for the misunderstanding, it took me some time to figure it out how to do it. Hope that I am able to explain things better here on why this is the case.
You see when I was using the excel file BlogPost.xlsm, I did not touch nor modify the Microsoft Excel Objects "Sheet1" and "ThisWorkbook" and hence when I tried to export the active project using Rubberduck VBA, only the four modules got exported.
Only when I touch the Microsoft Excel Objects and add a some text like Option Explicit
that I am able to export it. From there, further editing (removing the text) and export the active project using Rubberduck VBA works even when the Microsoft Excel Objects inputs are empty (no text).
Below is some gif images on how it went for me, I was able to export only Sheet1
and later both Sheet1
and ThisWorkbook
This is using the "Export Active Project"
This is using the "Export Project" from Code Explorer
Not sure if this is reproducible from your end with BlogPost.xlsm but I hope it is.
Nevertheless, I can modify the blog saying that it export a .doccls file with a picture below.
As for the other two feedback, please give me some time to take a look it.
Thank you.
Oh! Skipping empty modules is a feature, not a bug đ
Should probably be made configurable, but if I recall correctly it was made that way because users usually didn't want to export empty worksheet modules.
As for annotations, if you type them up manually they're really just comments that Rubberduck parses as annotations; if an annotation is missing its hidden attribute, or has a different value than the hidden attribute, Rubberduck issues inspection results under "Rubberduck Opportunities", and proposes quickfixes to sync the hidden attribute with the annotation comment (or vice-versa). Alternatively you could use the "annotate" command from the context menu to do it all in one step with a UI.
Oops, wrong account đ¤Ş
Hi, thanks for the explanation. I have added these new information to export and import Excel VBA files. to the blog post.
Regarding the annotations, I tried to add them in the sheet
But the code inspector complain that there is no attributes.
However, when I try to add the attributes inside the function. I have a compiler error.
It seems that I have failed to understand the use of the attributes at this point of time. A likely reason is because I don't have a class object or maybe it is not needed.
Please advise.
Let me explain this. You are right that you cannot add attributes in the VBE, which is a questionable design decision by MS, IMHO. However, you can add them in an exported module and when you import it, the attribute will apply, but still not be visible in the VBE code pane.
Since this is an annoying process and the existence of the attributes is not transparent to the programmer, we introduced the attribute annotations. When you add them and the value is different to the current attribute value, there is an inspection result. Depending on whether the attribute is missing or has a different value, there will be a quick fix available to add/sync the attribute. Just right click the inspection result and look for the right one. These quick fixes will do the job of exporting, manipulating the text file and reimporting for you.
Hi,
I think I understood how to get the description annotation to work now. Here is what I have done...
First, key in the Module Description and Description. Ensure that the Module Description is on the top of the file and the Description is top of a given function.
Next, open Code Inspection (Rubberduck -> Code Inspection), click on Refresh button. You should see the following âRubberduck Opportunitiesâ.
Select multiple of such issues by ⢠Clicking on the first file ⢠Hold down the Shift key, select the last file or folder, and then let go of the Shift key. or ⢠Hold down the Ctrl key and click any other file(s) or folder(s) you would like to add to those already selected. Right click on the selection, go to âAdd missing attributeâ and then âSelected occurencesâ
Rubberduck will then add these attributes into Micorsoft Visual Basic for Applications.
This is what you should see. On the Rubberduck toolbar, the content of the Module Description will appear when the module opened and selected
The content of the Description will appear when the function is selected
Opening the object browser
And selecting Blogpost {Name of Excel File} specific libraries
Click on the module with the Module Description and you can see its content there
Click on the function with the Description and you can see its content there
This information is also available in the Code Explorer as well.
Hi,
I have written a blog post on how to write better excel vba code using Rubberduck and Natural Docs. https://jeremy-selva.netlify.app/blog/2022-05-05-writing-excel-vba-code
I have also used it in my lab project https://github.com/SLINGhub/MSTemplate_Creator
It will be nice if I can use your logo picture in the blog post so that people can better understand/remember the software. Nevertheless, it is best for me to ask for permission just to be on the safe side. Hopefully it is alright for you.
Thank you.