Skip to content

QuickFix 'Add Missing Attribute' causes an illegal attribute value given non-literal annotation argument #4946

Open
@ChrisBrackett

Description

@ChrisBrackett

Rubberduck version information

Version 2.4.1.4688
OS: Microsoft Windows NT 10.0.17763.0, x64
Host Product: Microsoft Office 2016 x64
Host Version: 16.0.4810.1000
Host Executable: EXCEL.EXE

Description
The last time I applied the "Add Missing Attribute" hotfix for a member attribute annotation I went from this:

'@Description("Resets the cache of all pivot tables in the target  workbook and removes filters for items no longer in the source data." & vbnewline & vbnewline & "NEW LINE HERE")
Public Sub ResetAllPivotCaches(ByVal targetBook As Excel.Workbook)

...to this:

'@Description("Resets the cache of all pivot tables in the target  workbook and removes filters for items no longer in the source data." & vbnewline & vbnewline & "NEW LINE HERE")
Public Sub ResetAllPivotCaches(ByVal targetBook As Excel.Workbook)
Attribute ResetAllPivotCaches.VB_Description = "Resets the cache of all pivot tables in the target  workbook and removes filters for items no longer in the source data." & vbnewline & vbnewline & "NEW LINE HERE"

The code couldn't compile with that attribute as a visible line of code (syntax error), however RD did not show an error even after I initiated a couple of redundant reparses.

To Reproduce
Steps to reproduce the behavior:

  1. Download this file (Module1.bas.txt) and remove the .txt extension (so that it's called Module1.bas):
  2. Import it into a new/empty VBA (I used an Excel workbook).
  3. Have Rubberduck parse the file and then apply the hotfix to "Add Missing Attribute".
  4. See how the attribute is added as visible code that cannot be compiled.

I was able to reproduce the error after exporting the module and re-importing it into a fresh Excel workbook.

Logfile
RubberduckLog.txt

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions