Undocked tool windows suddenly seem to be appearing slightly off screen. I believe that this is new in .4003 as I've never noticed it before. ![2018-10-23 07_39_57-todo explorer](https://user-images.githubusercontent.com/11889733/47358317-6f450480-d697-11e8-9f1c-ef81cea3e9ae.png)
In order to move the window, I have to hit <kbd>Ctrl-M</kbd> then <kbd>↓</kbd> several times until the window header appears. Then I can use the mouse to drag it. This happe
> FYI, I can no longer reproduce this using the code from the original report. Copying the code as-is into an Excel project with recent pre-release of RD, I did not get a parser error.
However, I still do get a parser error with the 2nd example:
``` Public Sub Blah() If True Then: Debug.Print "It's still a single-line statement": 'Try adding `End If` here. It won't happen End Sub ```
So it may have been partially fixed in the intervening time.
@Duga is awake and caffeinated, but @FreeMan isn't - he thought @Vogel612 was declining his issue. Didn't grok the 'edited label' vs 'added label' detail...
This is interesting... I did a C&R on my Access project and it generated an error. In researching what that error means (I still haven't found that specific error code yet), I saw several suggestions to "create a new accdb and import all your objects into it", so I gave it a try.
Here's the list of references from my original project:
(I crossed them out as I added them to the new project) Note the OLE Automation in the original
here's the list of references from the new project:
No OLE Automation but the new one compiles clean. That's fine by me. However, note the Visual Basic for Applications which is NOT selected as a reference in the original project. The new test project will not allow me to deselect it stating that it's in use.
The first 2 references in most VBA projects are always in use
the stdole2.tlb (that's OLE Automation is one of the references that is set by default when you create a new VBA project, but technically it's not a required references and you can usually do without it. (Or at least I haven't found a reason to require it)
The original project must have been in such bad state that it couldn't list VBA as the first reference.
I've got error -1504 with a description of You tried to assign the Null value to a variable that is not a Variant data type. and error table is MSysNavPaneGroupToObjects
no luck so far trying to figure out what that actually means. Is that a code error?
everything compiles clean, and, as far as I'm aware, runs clean.
ooohhh, goody! just got the MS Home Use Program email telling me I can get Office 2019 for only $15!!
wonders if he can buy multiple copies... Merry Christmas to the family!
Design theory question: I have this function signature:
Private Function LoadDataFromExcel(ByVal ClinicID As Long, ByVal Address As String, ByVal XLname As String, _
ByVal InsertColumns As String, ByVal SelectColumns As String, ByVal NextInsertDate As Date, ByVal TableToUpdate As String) As Long
Would it make sense to create a UDT (local to the module that contains the function and all call sites) with all those values and pass a single parameter of myUDT?
approximately where is the line between "that's OK" and "that's too many parameters"?
@FreeMan the line is where you draw it, really. if you have a hunch that something's off, something's probably off. ClinicID and Address (and possibly some others) look closely related
> Need to add an inspection that recommends refactoring (by creating a User Defined Type) `Sub` or `Function` signatures that have more than 3 parameters.
AIUI, RD has no control over placement of the windows when they open, but I'd think that after opening the dialogue box, we could get the UL corner position, then move the window to make sure it's somewhere sane
> FWIW, I think it should recommend class by default. While I would have preferred to use the lightweight UDT, it is straddled with far too much limitation that recommending it would lead to more frustration and thus distrust for the ducky's recommendation.
@Comintern & @Hosch250 the good news is that no matter whose fault it is, the duck should be able to find the top left corner of the window and make sure the value is sane before returning to the user, right?
if I refactor a method's parameter list into a class, how specific do I get in tying the name of the class to the particular method? After all, the class would really only be usable for the one function...
@FreeMan We could, because we're already in the message pump, but I'd consider trying to accommodate a Windows bug to be bad UX - there are legit reasons where you would want to move a window partially off the left of the screen (although probably not the top). We'd also be dealing with the VBE window hack, and IIR that can send some bizarre location messages. I'm not sure we want to mess with it
@Comintern When Vogel found one of those weird location message where it wanted ot put it at a negative location, I've always wondered if those were in fact special coded message that had meaning to VBE while totally violating the specs as documented by Win32.
> Please leave the cursor where it is or go back to the same line after indenting. For large procedures it's a real elbow having to scroll down to where you were!
> Mike, thanks for the report! We'll look at it. Note that I removed the email address to avoid harvesting; the GitHub notification system will email you with updates.
> When I use rubberduck it takes up a line of it's own in the VBE reducing the code window. I always untick it from the toolbar menu until I want to use it. This is not persistent. When I open the VBE again or in a different application then I have to untick it again... and again.... and again...... Please make unticking rubberduck persistent for when opening the VBE.
> This is actually by design because the status bar can take lot of space, so the button is always "temporary" and added to its own line to ensure there is enough space to display all the data.
That said, this can be an enhancement to not show it by default until you actually parse via the menu items.
@Duga Technically, the RubberduckCommandBar is not temporary. We simply add it on load and remove it on unload because we get a crash on exit, otherwise.
> We're explicitly creating & destroying the toolbar because letting the VBE do it easily translates into leaked objects and serious problems on teardown.
IMO best we can do is to add a setting to optionally keep it hidden by default. VBE docking and window/workspace persistence isn't exactly cooperating nicely with VBE extensibility, and has zero chance of ever being improved by Microsoft.
Keep in mind we're a .net application from 2018 interacting with COM tech from 25 years ago.
> Version 2.2.6672.28001 OS: Microsoft Windows NT 10.0.16299.0, x64 Host Product: Microsoft Office 2013 x86 Host Version: 15.0.5045.1000 Host Executable: MSACCESS.EXE
This is persisting after fixing the error and getting a successful compile. [RubberduckLog.txt](https://github.com/rubberduck-vba/Rubberduck/files/2506927/RubberduckLog.txt)
``` 2018-10-23 09:09:34.7387;ERROR-2.2.6672.28001;Rubberduck.Parsing.VBA.ComponentParseTask;COM Exception thrown in thread 44 while parsing module BasicInclude, ParseTaskID 5b3e6281-7194-460b-be89-9bb1ca588dae.;System.Runtime.InteropServices.COMException (0x800AC372): Exception from HRESULT: 0x800AC372 at Microsoft.Vbe.Interop._VBComponent.Export(String FileName) at Rubberduck.VBEditor.SafeComWrappers.VBA.VBComponent.ExportAsSourceFile(
#If VBA7 Then
'advapi32
Public Declare PtrSafe Function apiGetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
'kernel32
Public Declare PtrSafe Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal length As Long)
Public Declare PtrSafe Function lstrcpy Lib "kernel32" (ByVal lpString1 As Any, ByVal lpString2 As Any) As LongPtr
Public Declare PtrSafe Function GlobalUnlock Lib "kernel32" (ByVal hMem As LongPtr) As Long
So missing PtrSafe shouldn't have had caused that error.
@Vogel612 OK - for some reason his message sounded as if he used "git" to email and thus open his issues. I guess more likely, he did it via GH, then replied to my comments via email.
> In Excel using `ThisWorkbook` but the story is more interesting than that.
I just tested the 2nd example in isolation and I do not get a parser error. So I deleted the 2nd example and went to the 1st example. Still no parser error. But if I then add _both_ 1st and 2nd examples to the `ThisWorkbook` module, then I get a parser error....
I should note that the pasting of the 2nd example is apparently chaotic; depending on when I cut'n'paste, I may get parser error.