« first day (2428 days earlier)      last day (752 days later) » 

12:01 AM
RELOAD!
[rubberduck-vba/examples] 1 opened issue.
[rubberduck-vba/Rubberduck] 1 issue comment.
[Minesweeper] Games Played: 50, Bombs Used: 36, Moves Performed: 7505, New Users: 8
 
 
10 hours later…
9:44 AM
> Same problem here: after a fresh installation (my first RD install), I permanently see the same message _Rubberduck doesn´t seem to see anything yet_ in the _Code Inspections_ panel.

I have ticked the _Run inspections automatically on succesful parse_ checkbox, and have clicked the refresh button several times.

![imagen](https://user-images.githubusercontent.com/11045297/106118104-0725d880-6154-11eb-8aa2-6b090d24df6c.png)


The _Code Explorer_ panel show no items, and the _Test Explo
 
9:55 AM
> Same problem here: after a fresh installation (my first RD install), I permanently see the same message _Rubberduck doesn´t seem to see anything yet_ in the _Code Inspections_ panel.

I have ticked the _Run inspections automatically on succesful parse_ checkbox, and have clicked the refresh button several times.

![imagen](https://user-images.githubusercontent.com/11045297/106118104-0725d880-6154-11eb-8aa2-6b090d24df6c.png)


The _Code Explorer_ panel show no items, and the _Test Explo
 
10:09 AM
> @oscarda Does your code compile? Our parser seems to have a problem with line 39 of the module `Analizador`.

The refresh button in the command bar should show some localized form of _Parser Error_. Moreover, next to it, there should be a small red icon, which you can click to get a list of the parsing errors. Double clicking one should navigate to the spot our parser failed.
> **Rubberduck version information**
Version 2.5.1.5557
OS: Microsoft Windows NT 10.0.14393.0, x64
Host Product: Microsoft Office x86
Host Version: 16.0.11929.20648
Host Executable: MSACCESS.EXE

**Description**
After fresh installation, and clicking on any rubberduck 'refresh' icon, TestExplorer gets stuck showing non-stop the 'processing' rubberduck spinning ring. Also, all the TestExplorer menus are disabled, appart from 'add Test Module', that works correctly.

**To Reproduce**
St
 
10:54 AM
> That the test explorer animation does not stop upon a parser error seems to be a bug, indeed.

As I also wrote in a reply to your comment in #4980, the reason why everything stays deactivated is that there was a parser error. You can see that in the command bar. Clicking on the red button will allow you to navigate to the parser errors RD encountered. Based on the logs, this should point you to line 39 of the module `Analizador`.

Note that we need to parse the code in order to make sense
 
11:43 AM
> @MDoerner thank you very much.
Though my code seemed to be working, rubberduck parser had found two issues. Once I have solved them, everything is working correctly.
I hadn't noticed the parser error message and icon on the command bar.
![imagen](https://user-images.githubusercontent.com/11045297/106133791-0433e380-6166-11eb-8c41-2df7186236ec.png)

Most grateful for pointing me in the right direction!!
> Thank you @MDoerner!!
As you point out, once I have solved the glitches in my code (spotted by Rubberduck), the parser can finish correctly, and the refresh progress ring is not stuck any more.

By the way, the _Code Inspections_ tips are most helpful. I'm impressed with Rubberduck and the excellent team behind it!!
Best wishes!!
 
12:16 PM
> I reopen thins because the the eternally spinning animation in the test explorer really is a bug. In case of a parser error, it should stop and revert back to the initial state.
> @oscarda One side note regarding the previously undiscovered issues in your code. In the VBE's options, there is an option to compile on demand, which probably is checked. This has the effect that the VBE essentially only compiles what is needed to run the code you are trying to execute. This can mask issues in other modules not necessary for what you run. So, our recommendation is to turn it off and let the compiler always compile the full project on execution, or more precisely, all uncompil
> Changed "db" to .Self in DefaultDbCommand example
 
12:46 PM
> Version 2.5.1.5676
OS: Microsoft Windows NT 10.0.18363.0, x64
Host Product: Microsoft Office x86
Host Version: 16.0.13530.20440
Host Executable: EXCEL.EXE

A function call FNNAME(a) is raised as a Code Quality Issue, local variable FNNAME is not declared.
The project compiles. The module has
Option Explicit
Option Private Module
The module containing FNNAME does too.
Making the fn Public does not change the issue.
Moving the function into the same module as the caller, and click
 
 
2 hours later…
2:50 PM
0
Q: Create Table After Deleting Rows Before Desired Range and Filter to Delete All Other Unnecessary Rows

Bob the BuilderThe code below first searches for the first searchText and deletes all rows that precede it to establish a range for a table object. Once the table object is created, it's filtered by unnecessary fields. After ensuring the searchText is in the first row (header), it deletes all visible rows below...

 
 
4 hours later…
6:52 PM
I saw a few threads over the Internet, but no one explained :( Debug.Print ThisWorkbook.Sheets(1).Range("A1") Is ThisWorkbook.Sheets(1).Range("A1") // return false. Maybe someone here knows whats going on Range+Is... :)
It seems that the problem with ridiculous result of Is occurs only with Ranges
 
 
2 hours later…
8:43 PM
The default return from the Range object is .Value which returns a Variant. So you are always going to get some implicit conversion. docs.microsoft.com/en-us/office/vba/api/Excel.Range.Value
However, it's also an object. If you use Is then you are doing object comparison, not Value comparison.
I think what you are seeing is two different objects that point to the same range. The objects are different even if they point to the same object
So if you want to compare the .Value then you can't use Is, which is for object comparison.
Debug.Print ThisWorkbook.Sheets(1).Range("A1").Value = ThisWorkbook.Sheets(1).Range("A1").Value // returns True
 
Allo allo..... I have another little question to pose to the ducks please.....
I have just seen this Dim Document As HTMLDocument: Set Document = CreateObject("HTMLFILE") in someone's code
 
This also returns True:

```
Dim theRange As Range
Set theRange = ThisWorkbook.Sheets(1).Range("A1")
Debug.Print theRange Is theRange
```
 
Early bound declaration but late bound instancing
VBE does not complain and you end up with an instance of the early bound (declared) class.
 
This returns False:

```
Dim theRange As Range
Set theRange = ThisWorkbook.Sheets(1).Range("A1")
Debug.Print theRange Is ThisWorkbook.Sheets(1).Range("A1")
```
Because they are different objects
 
I guess I just find that ability to do that partic mix and end up with the early bound a little odd.
 
8:53 PM
Does Rubberduck have an inspection for that?
 
HTMLDocument and HTMLFILE are the same class
Mixing the two provides no benefit. The code will bomb without a reference still.
 
Mixing early- and -late binding in this fashion shows up fairly frequently in SO questions.
 
That's so odd. I wonder why
 
@HackSlash How will it bomb please? I thought HTMLFile was different. It is older (like <=IE8) and exposes far less methods than the early bound MSHTML.HTMLDocument
 
If you don't have a reference to Microsoft HTML Object Library then you will get Compile Error: User-defined type not defined
 
8:57 PM
Ah.... no the user has added the lib. I assume they just forgot to fully convert code from late to early.
I am just surprised that the type declaration won over the method of class instantiation.
But that is just my lack of knowledge I guess.
 
I would change it to ``` Set Document = New HTMLDocument ```
 
Correct and/or qualify with MSHTML
How can I inspect that they are the same class?
If they expose different methods surely they are not the same class?
 
I am not sure if I understand ok: so this strange result of 'Is' is caused by range's default member - .Value? It seems there is no other object in VBA with the same behaviour. Is it the only exception?
 
No if you're using Is then you're comparing objects and .Value doesn't come into play at all.
 
So another bug/gotcha in our lovely VBA... :D
 
9:07 PM
No bug. Object comparison always returns false when using two different objects
 
But why there are 2 different object ONLY for Range object in this case? E.g. if declaring two different variables ThisWorkbook.Sheets(1) - the Is returns true
 
@BigBen It isn't picked up.
 
I mean something like this Set ws1=ThisWorkbook.Sheets(1), Set ws2=ThisWorkbook.Sheets(1), ws1 Is ws2 // true
 
One must be returning ByVal and the other ByRef
that is odd
 
It really depends on the implementation internals whether a function returning an object returns the same object for the same input each time or not.
It actually makes sense that Sheets returns the same object and Range does not.
 
9:15 PM
Maybe yes, but it' quite counter-intuitive that fully qualified Range's behaviour is different from the other objects... But thanks
 
Sheets(1), which is actually Sheets.Item(1) is just a lookup in the Sheets collection of the workbook, i.e. you look for an existing object.
On the other hand, range objects need to be generated based on the input anew; it is completely impractical to have them lying around for every possible input.
If you got the same object, then some cashing would be involved, but that is apparently not the case.
 
@QHarr If we try to make an HTMLDocument without a reference we see that it's not a valid object:

```
Dim htmlDocument As Object
Set htmlDocument = CreateObject("HTMLDocument")
```

This gives us run-time error 429: ActiveX component can't create object

If we instead use HTMLFile:

```
Dim htmlFile As Object
Set htmlFile = CreateObject("HTMLFile")
```

It makes an object of Type: Object/HTMLDocument

Thus HTMLFile is the object and it's name is HTMLDocument. Which is confusing.
 
@M.Doerner that makes a lot of sense
 
One further point is that a range object has more internal state than the underlying range. E.g., it saves whether it consists out of cells, rows or columns, which is wholly another problem with them.
You can observe that by looking at the behaviour of Item on ranges obtained via Cells, Columns and Rows.
 
@HackSlash Ok. But because of the declaration it ends up as HTMLDocument as type in the original scenario
 
9:30 PM
@M.Doerner "wholly another problem" might be an understatement haha.
 
"a range object has more internal state than the underlying range" Could you write this in simpler english, please? This is very interesting, but unfortunatelly my english isn't very good... Thanks in advance. I am trying to learn about the difference with Range object itself.
 
10:34 PM
What I meant is that the range object contains more internal information than the range in the worksheet is refers to.
The state of the range it refers to consists of the value, formula and address of the cells, among many other pieces of information.
In addition, there are other kinds of information that have nothing to do with the referenced range, like whether you are looking at it as a collection of cells, of columns or of rows.
You really would not want to have this additional information/state shared between all values returned from a function. So, it makes sense to hand out individual objects instead of always the same cached one.
 
 
1 hour later…
11:47 PM
I must read all your comments one more time carefully. It seems like worksheet object has a lot of "additional information" e.g. Cells collections too, that you can refer to, but its behaviour with "Is" is different than Range
 

« first day (2428 days earlier)      last day (752 days later) »