« first day (2790 days earlier)      last day (390 days later) » 

12:00 AM
REFRESH!
[Minesweeper] 128 Games Played. 67 Bombs Used. 15486 Moves Performed. 18 New Users
[rubberduck-vba/Rubberduck] 319 additions. 1 issues opened. 27 deletions. 7 commits. 1 issues closed. 20 issue comments
 
 
13 hours later…
1:19 PM
> Thank you for the help! I will test that today.
 
2:04 PM
> I have found the issue. Removing option explicit made no difference and i got a parse error with and without it. However i noticed an issue in my code where i was declaring a variable outside a sub which was causing the issue.

This code causes a parse error.
`
Private Sub Workbook_SheetPivotTableUpdate(ByVal Sh As Object, ByVal Target As PivotTable)

With ActiveSheet.Range("A:BG")
.EntireColumn.AutoFit
End With

With ActiveSheet.Range("A:C")
.ColumnWidth = 1
End With

End Sub
> I have found the issue. Removing option explicit made no difference and i got a parse error with and without it. However i noticed an issue in my code where i was declaring a variable outside a sub which was causing the issue.

This code causes a parse error.

```
Private Sub Workbook_SheetPivotTableUpdate(ByVal Sh As Object, ByVal Target As PivotTable)

With ActiveSheet.Range("A:BG")
.EntireColumn.AutoFit
End With

With ActiveSheet.Range("A:C")
.C
> I have found the issue. Removing option explicit made no difference and i got a parse error with and without it. However i noticed an issue in my code where i was declaring a variable outside a sub which was causing the issue.

This code causes a parse error.

```
Private Sub Workbook_SheetPivotTableUpdate(ByVal Sh As Object, ByVal Target As PivotTable)

With ActiveSheet.Range("A:BG")
.EntireColumn.AutoFit
End With

With ActiveSheet.Range("A:C")
.ColumnW
 
^ interesting issue. seems like module level variables are weird
also code formatting is annoying to edit by hand...
 
That code doesn't compile though right?
 
OP says it does...
 
That Dim is in the wrong place though, right?
 
'sfar as I know, yes, but I haven't touched any VBA in almost a decade now
so make of that what you will :D
 
2:15 PM
^^^ you have made a good decision ^^^
 
 
1 hour later…
3:21 PM
> I have found the issue. Removing option explicit made no difference and i got a parse error with and without it. However i noticed an issue in my code where i was declaring a variable outside a sub which was causing the issue.

This code causes a parse error. Obviouly this is a mistake in my code but is it still intended behavior to cause an error?


```
Private Sub Workbook_SheetPivotTableUpdate(ByVal Sh As Object, ByVal Target As PivotTable)

With ActiveSheet.Range("A:BG")
 
3:37 PM
I think I will have a look at this, maybe tonight.
According to the VBA spec, the code should not compile, but if it does, we might have to change the grammar, potentially with quite a few further things needing adjustment.
According to the spec, module level variable declarations are only legal int the declaration section, which basically ends with the first module body.
 
It definitely doesn't compile.
(I think OP's edit addresses this indirectly: "Obviously this is a mistake in my code")
 
 
2 hours later…
5:54 PM
OP presumably can run some code in that project, assumes the code consequently compilés - but if that particular module isn't loaded / not in any execution path of the entry point, then short of actually compiling, a parser error is exactly what RD should do. #StatusByDesign
 
 
3 hours later…
8:48 PM
dang autocorrect is driving me nuts ever since I added fr-CA lol that was "compiles" (and had to fix it here too!)
 
 
2 hours later…
11:12 PM
> The VBE will not compile VBA code that isn't in a module that's not loaded in the execution path of a given entry point. For example if you had Module1 with invalid code, and a macro in Sheet1 and nothing in Sheet1 is referring to anything in Module1, the Sheet1 macro can still compile and run even though the project as a whole won't.

You can manually verify whether your project compiles using the "Compile (ProjectName)" command from the Debug menu... or, there's a setting in Rubberduck to re
 
11:45 PM
[rubberduck-vba/Rubberduck] 1505 stars vs. [decalage2/oletools] 1893 stars
 

« first day (2790 days earlier)      last day (390 days later) »