that inspection results toolwindow is getting more and more useless
the more inspections we implement, the more clogged it gets, and the more issues if finds, the more results get aggregated to try and salvage some performance... end result, you get a bunch of results and need to navigate/fix them one at a time, much like fixing compile errors with vanilla-VBE
I just double clicked each of the 4 lines I showed in the screen shot & they all jump me to the same line of code, none of which are appropriate to the error reported.
@Comintern also it strikes me that there is no CATID for that registry. In contrast, all of our COM-visible classes get decorated with a CATID for .NET Category, which I believe is used by mscoree.dll to help it load the class using the extra keys that normally aren't used by COM itself.
I have a form in Access; when you put the cursor in a text box or combo box, and then click a blank area, it doesn't go away. Just vexing. I want it to respond like the message field I'm typing in now. Click an open area next to it and it is unselected or focus is unset.
TIA
@AnsgarWiechers the word tag carries that information. VBA is a language, not a type library. Here the language is PowerShell.... — Mathieu Guindon6 secs ago
@this ok, color me confused. it's not doing that here
Does @Duga have a post limit? I thought I saw something along those lines when I was looking at the CR question but that might have been when scraping comments from SE
@bruglesco FYI, about your job search, I've been thinking you might want to look into some hard CS stuff. Normally, I wouldn't recommend this, but C++ is often used specifically because there are constraints (time, space, etc.) where at least a moderate understanding of these will help.
Also, pick one project and get a bit of experience with it. You want to have something to be able to talk about more/less extensively in an interview.
"Sword of Latent Fatality", made of a chromium alloy. Might not get you today, but in 15-20 years you could start to develop thyroid cancer. On the plus side, you get to meet Erin Brockovich! — Pink Sweeteneryesterday
hmm ... I don't usually need describe. If I could make proper use of it, I usually do a log --graph --decorate --oneline which is ... a bit more useful
would the best way to globally ignore '@Ignore ... be to s/'@Ignore/'@ Ignore?
I'm thinking about all the inspection results that don't quite work right and that I'm ignoring until they're fixed. as fixes roll out, it would be worthwhile to remove all the ignores, let inspections run & see what still falls out.
ThisWorkbook.Worksheets(rngTemplate.Value).Copy
Dim shtNewTemplate As Worksheet
Set shtNewTemplate = ActiveSheet
MsgBox shtNewTemplate.Name
shtNewTemplate.Move After:=wbkEmployeeAudit.Worksheets(wbkEmployeeAudit.Worksheets.Count)
MsgBox shtNewTemplate.Name
@Tim yeah... though general "computer programming" vs the historical lingo & heritage of BASIC -> QBASIC -> VB might not necessarily be the same IMO. — Mathieu Guindon2 mins ago
if I understood the code, correctly what you did was.... 1) copy the content of the template into memory, 2) set a variable to the ActiveSheet, 3) move that sheet to some other place.
I don't see anything that creates the new sheet nor paste happening.
Unless it's somewhere else outside the code that you pasted.
@this No. When you use the .Copy method on a sheet object, it creates a new sheet object that is a copy of the original. If you don't specify a destination, it is placed in a new workbook.
@this You are right for using the .Copy method on a Range object, though.
@puzzlepiece87 Couldn't you ThisWorkbook.Worksheets(rngTemplate.Value).Copy After:=wbkEmployeeAudit.Worksheets(wbkEmployeeAudit.Worksheets.Count) and avoid the ActiveSheet alltogether?
@this So basically you suspect that shtNewTemplate is linked to the ActiveSheet function when I do it my way rather than simply to the sheet object that was created?
@puzzlepiece87 thinking about it a bit more, not exactly. You're not directly calling the ActiveWorksheet as I illustrated in my CurrentDb example but the principle is same; the underying object is transient so you can't assume it to be still there.
ThisWorkbook.Worksheets(rngTemplate.Value).Copy
Dim shtNewTemplate As Worksheet
Set shtNewTemplate = ActiveSheet
Debug.Print objPtr(shtNewTemplate)
shtNewTemplate.Move After:=wbkEmployeeAudit.Worksheets(wbkEmployeeAudit.Worksheets.Count)
Set shtNewTemplate = wbkEmployeeAudit.Worksheets(wbkEmployeeAudit.Worksheets.Count)
Debug.Print objPtr(shtNewTemplate)
Oh, I should probably use a third one in the middle
Dim shtNewTemplate As Worksheet
Set shtNewTemplate = ActiveSheet
Debug.Print objPtr(shtNewTemplate)
shtNewTemplate.Move After:=wbkEmployeeAudit.Worksheets(wbkEmployeeAudit.Worksheets.Count)
Debug.Print objPtr(shtNewTemplate)
Set shtNewTemplate = wbkEmployeeAudit.Worksheets(wbkEmployeeAudit.Worksheets.Count)
Debug.Print objPtr(shtNewTemplate)
@this Exactly right, that's what I was discovering. I figured that the worksheet variable would have the parent workbook object updated automatically as the worksheet object was moved around, basically.
But that was not the case. Black hole was the case.
Coming soon to a bookshelf near you, @SimonForsberg's new tome, The Proper Care and Handling of a Fickle, Female Chat-bot. Get your signed copy at a Borders Bookstore near you!
@MathieuGuindon Well, I don't aim at being a regular in here though. I'm only here when you folks have @Duga issues, or when I need some VBA opinion about a question...
I had 4 Consider renaming parameter 'x' inspections in a module. I double-clicked on the first one, came up with a gooderer alternative, then hit the quick-fix and selected Rename. When RD was done, all 4 were renamed. Is that Status-By-Design?
```VBA Public Property Let ColorID(ByVal x As String) pColorID = x End Property Public Property Let Red(ByVal x As Long) pRed = x End Property Public Property Let Green(ByVal x As Long) pGreen = x End Property Public Property Let Blue(ByVal x As Long) pBlue = x End Property ```
I get these inspections, which are perfectly reasonable: ![rd rename inspections](https://user-images.githubusercontent.com/11889733/42841597-919bc750-89d8-11e8-8328-
ummm... I just noticed that it renamed x across multiple modules, not just the one I was in.
I'm fixing up some poor parameter names in a different module and there's one called colorCode and the Leter has nothing to do with colors, so I would have never used that here...