« first day (1015 days earlier)      last day (2165 days later) » 

5:00 AM
[Hosch250/Rubberduck] Hosch250 pushed 45 commits to Issue2884 (only showing some of them below)
[Hosch250/Rubberduck] retailcoder pushed commit 99ed1ca5 to Issue2884: all IntroduceFieldTests pass
 
Uh, something happened in there.
MoveCloserToUsage has a failing test due to whitespace.
Did you merge something, @Mat'sMug?
 
I didn't mean to
don't touch anything, I'm on it
 
Yeah, not me. It was already failing.
Shoot. I already updated my branch.
The failing test hung AppVeyor good.
OK, I'm going to bed. See you tomorrow.
 
First YouTube comment: youtube.com/…
 
In a WPF DockPanel element can you have 3 elements one docked top, another bottom, and the third sandwiched in between?
 
5:09 AM
> I also watched the full video interview with RubberDuck founder Mr. Matt for giving insight into the project and look ahead.
^ Apparently you were captivating.
 
I was half asleep lol
 
lol
 
> Thank you David. I'll see what I can do. I'm in discussions with the developers of RubberDuck to figure out if we can get a mocking/stubbing framework to go with the unit testing so we have a complete solution. Hand rolling mocks is a pain.
 
^ False. Turns out it's pretty damned easy. Don't let me forget to sing the praises of EasyHook in README.md.
 
5:31 AM
@Comintern in VBA
 
@Comintern You can pass multiple parameters to the Get, and to the Let and Set too ;-)
 
@ThunderFrame Let/Set must have exactly one more parameter than the Get member for the code to compile ;-)
 
@Mat'sMug yep, and order is important
 
'tis
 
Soon on SO... Why does my property Let take 29 Fakes?
 
5:34 AM
lol
 
posted on March 17, 2017 by Rubberduck VBA

Rubberduck has been offering IDE-integrated unit test since day one. But let’s face it: unit testing is hard. And unit testing VBA code that pops a MsgBox isn’t only hard, it’s outright impossible! Why? Because it defeats the purpose of an automated test: you don’t want to be okaying message boxes (or worse, clicking No when the test needed… Continue reading Go ahe

 
soon on SO: how is this VBA code even legal?
 
VTC as dup of "How do I add a reference to Rubberduck?"
 
5:47 AM
lol
 
5:58 AM
[rubberduck-vba/Rubberduck] build for commit baf48e53 on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
> So yeah, we’re mocking VBA. All of it.
 
@Duga 1 hour build?
 
> Build execution time has reached the maximum allowed time for your plan (60 minutes).
stuck
uh-oh
> System.ArgumentException: replace op boundaries of <ReplaceOp@[@3,18:19='',<228>,1:18]..[@11,45:47='boo',<233>,3:23]:"(ByVal boo As Boolean, ByVal fizz As Date)"> overlap with previous <ReplaceOp@[@8,38:38='(',<212>,3:16]..[@16,59:59=')',<219>,3:37]:"(ByVal boo As Boolean, ByVal fizz As Date)">
IntroduceParameterRefactoring needs to be more surgical
 
6:17 AM
[retailcoder/Rubberduck] retailcoder pushed commit fce396f7 to rd-next: fixed a few tests. still WIP
 
darn - you'd think Office would have standardized across Apps when they introduced the Ribbon, but no, it's different
callback signatures are different
callback proc names have varying syntaz
Access favors Macros over VBA, if there is a conflict.
If Access and Excel are different - I can hardly wait to see what mess the Word team made.
it certainly doesn't help that one of the only official resources is from 2007, and is incorrect or out of date, or both
 
Would PowerPoint ribbon come into play here @ThunderFrame
 
[retailcoder/Rubberduck] retailcoder pushed commit 119e3b86 to rd-next: fixed a couple more, disabled the neverending test
 
@PeterMTaylor yep, and Visio, and probably Publisher and Outlook.
As with all things Visio, I'm anticipating it to be the most compliant and programmer friendly.
 
6:32 AM
[retailcoder/Rubberduck] retailcoder pushed commit 9ef72ecc to rd-next: fixed a few more MoveCloserToUsage tests. 3 introduce param failing, and encapsulate field needs work
[rubberduck-vba/Rubberduck] build for commit 9ef72ecc on next: AppVeyor build cancelled
Merge pull request #242 from rubberduck-vba/next

sync with main repo
 
repair is still WIP @anyone feel free to step in and fix the rest of the failing tests, I need to get some sleep and I won't be able to fix them until later tomorrow
'night!
 
6:58 AM
[rubberduck-vba/Rubberduck] build for commit a982fcc5 on unknown branch: AppVeyor build failed
BUILD FAILURE!
[rubberduck-vba/Rubberduck] build for commit 179de791 on next: AppVeyor build failed
BUILD FAILURE!
[rubberduck-vba/Rubberduck] build for commit 37e48056 on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
7:53 AM
RD must be eating into their customer base
 
 
2 hours later…
 
2 hours later…
12:00 PM
0
Q: Excel VBA Solver Loop taking too long

user133765I created a code that runs 60 optimizations through solver through 4 series of loops (each with 15 'iterations'). The code works great but it is taking FOREVER to run through (over an hour). Each optimization is a simple linear model (global solution is found), just changing which month I am look...

 
> When there are certain valid lines after one of the invalid syntaxes, the Parser Error can report that the problematic line and column is several lines beyond where the invalid syntax occurs.
> When there are certain valid lines after one of the invalid syntaxes, the Parser Error can report that the problematic line and column is several lines beyond where the invalid syntax occurs.
> When I right click a project in the _CodeExplorer_ and select `Rename`, nothing happens.
![rd project rename 1](https://cloud.githubusercontent.com/assets/11889733/24042589/0c000e0e-0ae9-11e7-8990-4e343a4e7f61.PNG)
![rd project rename 2](https://cloud.githubusercontent.com/assets/11889733/24042591/0e7f2fca-0ae9-11e7-9251-15efe938d1d1.PNG)
even after forcing a reparse.

However, if I right click the project and select `Project Properties`, it will rename the project and trigger a reparse.
 
monking, @all. I might have a few minutes to stop by and chat today...
 
monking
 
12:41 PM
> Even better we could prompt for "What folder would you like that to be in?" if it a module without an @folder was clicked.
> I would vote for an opt-in setting. I would immediately opt-in.
> This apparently isn't only an issue with `Debug.Print`. This example also produces a compile error:

```
Sub Foo()
Dim x As Long
x = Bar _
()
End Sub

Public Function Bar()
Bar = 42
End Function
```
This was probably a regression caused by the grammar change that picked up `ByVal` parameters, because it doesn't have a problem with indexers:
```
'This parses fine.
Sub Foo()
Dim x() As String
x = Split("1,2,3", ",")
Debug.Print x _
(1)
End Su
 
1:26 PM
anyone have any suggestions on finding external document links in an Excel file that shouldn't have any?
File|Info|Edit links to files shows that there's a link to another Excel document, but a search through the text doesn't turn up any part of that other file's name...
(Yes, I'm searching in formulas)
 
:deletes "did you check in...":
 
1:43 PM
@IvenBach see, I broke the RD build with a stupid PR done the wrong way around. #ReasonsToLearnGitCLI
 
@FreeMan if it should not be there, just remove them. Usually searching for ".xls" finds them all though
 
2:38 PM
@Ticker - 10 million rows in Access?
 
0
Q: Excel 'big' data processing with vlookups

Emily AldenI was given a mess of a code a while back that was a mess, and have completely rewritten it. However now the code takes .2 seconds per line which for a 500,000 line document is much too long. Purpose of the Code: This code takes the new information that has been provided by a cleaned data dump ...

 
2:53 PM
@Mat'sMug Unfortunately, I seem to be pretty good at accidentally creating links by copying formulas from one workbook to another (forgetting to copy the text and copying the cell instead), then not being able to find them by searching for .xls or part of the workbook name or anything else.
 
> Addresses comment for PR #2872 to organize test VBA code in separate static class.
[rubberduck-vba/Rubberduck] build for commit 10af0deb on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
3:11 PM
0
Q: Perf wrapper for Excel VBA

R3uKFor a while now, I've been using this wrapper to avoid retyping most of it : Public Sub PerfWrap(SubNameToRun As String, _ Optional ByVal DispStatusBar As Boolean = False, _ Optional ArgumentsToPass As String = vbNullString) Dim aWB As Workbook, _ ...

 
4:19 PM
> I think Opt-In is best choice. Suppose I have funky indenting I want to keep? Not sure if the smart indenter respect all manners of indenting.

Example of funky indenting I do, usually with `Declare` that involves a boatload of parameters...

Private Declare PtrSafe SomeSillyAPIFunction Lib "SomeSillyDLL" ( _
ByVal ptReserved As LongPtr, _
ByVal lpcstrSomeText As String, _
ByVal dwWords As SomeSillyAPIEnumeration, _
ByRef xxSOME_BIG_STRUCT As SomeSill
 
4:30 PM
> I agree this needs to be opt-in... Although we do handle some weird edge cases better than the original Smart Indenter did - how about an ask-once prompt at startup, like the "Import Smart Indenter settings from registry" prompt?
 
@Mat'sMug What broke?
 
@IvenBach I meant to sync my fork... and merged it into the main repo instead..
 
Oh... I couldn't figure that out by reading above.
That's something that wouldn't be good.
 
yeah, tell me about it ;-)
 
4:49 PM
I think I'm starting to internalize the 'self documenting code' ideas I've been reading. It's taken a while but now after I get something to work my first reaction is to refactor so it's simpler.
 
:+1:
 
@Mat'sMug Thanks for this, valuable for me.
I'm still going to err on the side of over-commenting but this helps me a lot to visualize new ways to make my code self-documenting.
 
@IvenBach Precisely what I just did myself.
 
After sleeping on my C# idea that I have I think I can articulate with clunky code what I'm attempting to do. I'll neanderthal it out tonight for codereview.
 
@Mat'sMug d'oh!
 
4:59 PM
yeah
 
That's ready to be merged, @Mat'sMug.
 
Take a look at the nice way I cleaned it up.
 
[rubberduck-vba/Rubberduck] build for commit a555c99e on next: AppVeyor build failed
BUILD FAILURE!
 
5:05 PM
@Hosch250 I saw - that's excellent :)
 
[rubberduck-vba/Rubberduck] build for commit 8e6172fa on next: AppVeyor build cancelled
[rubberduck-vba/Rubberduck] BZngr pushed commit 75c49dee to next: #2872 follow-up. Moved VBA code under test to static class
[rubberduck-vba/Rubberduck] BZngr pushed commit 10af0deb to next: renaming
 
Totally OT, but System.out.print("Do you want to play again? "); immediately made me think of WarGames. We now return you to your regularly scheduled Code Review...FreeMan 3 mins ago
 
[rubberduck-vba/Rubberduck] build for commit 53cad305 on next: AppVeyor build failed
BUILD FAILURE!
 
Didn't realize just how old that review was or I wouldn't have commented, but, oh well...
 
@FreeMan Java!
@Mat'sMug Want me to help you with the rewriter stuff to get the build passing again?
 
5:10 PM
if you have time for that, it would be awesome
 
Or should I start swapping out the IsBuildIn stuff?
 
@Hosch250 you'll want all tests to pass before you invert that logic...
 
Oh, makes sense.
@Mat'sMug You know, that Finders dict is kind of ugly.
 
also, you'll notice the fixes and refactorings now only modify the modules' rewriters; no module gets modified until its rewriter runs its Rewrite() method. for inspections we'll want that to be after the "fix all" loops have iterated all issues - and requesting a reparse before calling Rewrite() basically discards all pending changes
 
The internal conflict is real. I'm refactoring so much fugly code, code that I've written. I'm not sure whether to be proud that I recognize it as ugly/bad or ashamed since it's mine...
 
5:18 PM
Do you have any high school essays among your stuff?
 
@Hosch250 I was having issues with the promote local to parameter refactoring (IIRC) - it's doing too much changes in the rewriter (the test fails with something like an "overlapping changes" error); the approach needs to become much more surgical than what it currently is, e.g. instead of rewriting the entire arg list, it needs to insert the argument at the correct token position
 
Umm, sure.
It was just easier the other way when doing text manipulation.
I'm fixing the Introduce Parameter.
 
it's pretty easy actually - you get the ArgListContext, take its .Stop token (that would be the RPAREN), and you so know you need to insert at .Stop.TokenIndex - 1, with a context-sensitive comma+WS
 
@Mat'sMug You have your Insert the wrong way.
Insert's always take the index first, and then the content.
 
hey it's WIP
oh, and it needs to watch out for ParamArray - these babies MUST be last or we're breaking the code by inserting a parameter after it
 
5:22 PM
> Rather than having separate issues for each VBA function that needs to have an IFake implementation, this meta feature-request should be used to track and prioritize functionality that needs to be faked. The PR with the framework shouldn't be much longer, so it's time to start tracking these. In general, we should probably prioritize functions that disrupt unit tests (like MsgBox and InputBox) so let's get those covered before adding more to the list. Note that the vbe7.dll doesn't have
 
@Mat'sMug Yeah, I know.
 
Gosh, @Mat'sMug, this is a bit of a mess.
Basically, the refactorings are not at all designed to work like this.
I'll have to rewrite a couple of them.
 
I was considering rewriting the whole thing yeah
things get MUCH simpler without all the string-handling though
 
Yeah.
 
5:26 PM
the "tricky" logic is now figuring out token indices
 
Well, I'll go have lunch and work on this bit by bit.
 
cool
 
I'll take Introduce Parameter.
That way, I shouldn't interfere with your Introduce Local.
 
ok
 
> Shouldn't CurDir be implemented too, with ChDir changing its return value?
> Should CurDir be implemented with ChDir changing its return value? Or that's for the user's setup code to do?
> @retailcoder - I was thinking of building a complete mock filesystem to attach when any of the file handling functions were faked. Maybe in its own namespace? Something like:

`Fakes.FileSystem.CurDir.Returns("C;\Foo")`

Maybe with it's own configuration. Could probably do both too - allow the above **and** the option to do:

`Fakes.CurDir.Returns("C:\Foo")`
> @comintern that. we should mimick the standard library's structure, so `MsgBox` would be under `Fakes.Interaction.MsgBox` for example.

How would mocking, say, a `Worksheet` or a `Range` object work?
 
5:39 PM
that fakes thing is completely sick
@Duga or heck, a Recordset or ADODB.Connection?
@Comintern ^
 
Would mimicking the library structure make functions less discoverable though? It requires that the user knows how the namespaces are set up.
ADODB would be completely sick.
As far as other libraries, I'm thinking that the FSO would be a logical first target - it could reuse code from the filesystem stuff in VBA.
 
do we need to implement C# code for all the things? or is there a way to make some "generic fake" that can be used to setup any class?
@Comintern agreed
and then ADODB :)
 
IVerify needs to know the parameter names at very least for the internals. When I get working on seeing what needs to be done to mock an interface, those can probably be more generic.
 
> @retailcoder - It depends. For COM objects, EasyHook needs an instance to examine the interface for. IIR, the object itself is always going to be a parameter on the interface call so we could either tie them to specific user created objects or try to emit a managed class that implements the passed interface. It basically needs some more research.
 
@Duga I want that!
We have to be able to fake user interfaces! =D
 
5:48 PM
I'm going to play with seeing if I can narrow the scope of hooks against the kernel debugging APIs too. If I can figure out how to narrow the scope of the hook to just VBA user code...
Can you say stack traces?
 
Oooooh!!!
 
...and then I'll eat vbWatchDog's lunch, take them behind the woodshed, and make their paywall'd product look like a toy at the bottom of a cereal box.
3
 
LOL
 
Almost done.
Down to one failing test--and simpler code.
 
5:53 PM
CleanFail:
    Debug.Print Err.Message & vbNewLine & RDebugger.StackTrace
 
Uh, what?
IntroduceParameterRefactoring_PassInTarget_Nonvariable
refactoring.Refactor(state.AllUserDeclarations.First(d => d.DeclarationType == DeclarationType.Variable));
...
No wonder it is failing...
 
I might have messed that one up lol
 
RDError.Finally("Label") would be sick.
 
^^^
 
5:55 PM
[Hosch250/Rubberduck] Hosch250 pushed commit a8dc021c to Issue2884: Introduce Parameter works
 
Duh check: When refactoring code is complete updates may be required to unit tests to make them applicable once again, correct?
 
@Hosch250 notice I removed the indentation on most rewriter-involving tests; we need a bunch of tests dedicated to testing how the rewriter deals with WS tokens
 
Some checks that were previously done could no longer be applicable?
 
Yeah, I saw.
 
@IvenBach what do you mean?
 
5:56 PM
@Mat'sMug Half of your problems were you were bloody injecting the rewriter everywhere.
 
@IvenBach Refactoring code can be completed?
 
You can't do that because these inspections work on multiple modules...
 
@Hosch250 yeah, that was probably from before I made the RPS cache the rewriters
 
[Hosch250/Rubberduck] Hosch250 pushed commit bb4acde2 to Issue2884: Clean up refactoring
 
I refactored code that was looking at 2 separate tables so it now only requires 1 table. A previous test was using the 2nd, now obsolete table.
 
5:57 PM
OK, @Mat'sMug, get rid of your Introduce Local changes--here I come.
 
sure!
 
Er, Introduce Field.
 
> @comintern Could we just do a CreateObject of the application, dump stuff in the temp folder and then delete once done? That way, Fake is dealing with a dedicated instance of Excel/Word/other Office application, and thus would model its behavior much more accurately than an actual Fake implementation.

This isn't a general solution, though because that makes assumption that there's an Application object that we can instantiate and configure to use the Temp folder for the rest of testing. No
 
@Hosch250 doesn't matter - you just state.GetRewriter(module) to get the rewriter (with its pending changes) for the module you want to work with
 
@Mat'sMug Yep, I just did that instead--fixed all the interface tests right off.
Oh wait, Introduce Field already works.
 
5:59 PM
but yeah initially I was injecting the rewriter
 
[Hosch250/Rubberduck] Hosch250 pushed commit 4c83b11e to Issue2884: Swap Insert parameters and rename
 
I'm PR'ing this before I tacked Encapsulate.
 
[Hosch250/Rubberduck] BZngr pushed commit 75c49dee to Issue2884: #2872 follow-up. Moved VBA code under test to static class
 
why do I feel the [next] branch will have a green build before I even get home tonight...
 
Because I have a reputation?
 
6:03 PM
lol
I wonder if there's a way to detect whether a rewriter change is overlapping before we push it onto the modification queue... that way we could detect whether a code change requires a reparse or not
 
[rubberduck-vba/Rubberduck] build for commit 11b3caf8 on next: AppVeyor build failed
BUILD FAILURE!
 
@Mat'sMug When I started Introduce Param, one of them had an issue with that.
 
> @bclothier - Maybe, but most likely not. I'm guessing the rtcCreateObject is just a thin wrapper around the VBA CreateObject function. If RD was hooking that and just newing up an object to mock the interfaces on, we might as well just use the existing objects. The other downside would be that anything we do inside a unit test that potentially creates new document objects probably isn't handled very well currently (IIR we're currently not disabling the parser if code is under test). Hoo
 
It didn't as soon as I stopped swapping the whole arg list around.
 
yeah that was because it was rewriting the entire arg list
TSR needs to be surgical
 
NICE ! the free encyclopedia — Shai Rado 12 secs ago
 
6:24 PM
> The inspection's meta reads like this:

> A variable is declared, but never assigned a value/reference. [...]

But it fires for undeclared variables that aren't assigned, too - let's just drop the part about it being declared, that would be a holdover from before Rubberduck supported undeclared variables.
> Sounds like a tech-debt that needs to be paid to me. The question is: how much code are we breaking with this??
> @Vogel612 doesn't matter. The COM API is advertised (if at all) as an experimental feature, subject to breaking changes.
 
yay: move fast and break things :)
user image
6
 
6:39 PM
> This occurred to me the other day, and I'd already forgotten about it until #2885 reminded me - time to open a feature request.

We can easily tell if users are taking advantage of RD features like unit testing and the API. It would be nice to be able to provide an additional level of warning for some of them along the lines of:

> Use of an experimental Rubberduck feature. This may either not be stable in the current build, be subject to future interface changes, or both. Save your work
> @comintern, well, I wasn't thinking of just a straight `CreateObject` anyway. As I alluded to, additional configuration would be necessary so that it works in the temporary filesystem and maybe even use RD's eventual fake filesystem. As part of the CreateObject build-up, you can configure RD to ignore that dedicated instance of Office application for testing, among other things.

The point is that I think it's easier and less buggy to extend the existing native objects than to supersede it
> Just a thought - one way to avoid breaking the old changes is to do what Microsoft did when they renamed their constants -- dump them in a module named OldConstants, then define new constants with same value. I know this exists in Access' object model, at least. That way, you can then deprecate 2 versions later and thus remove it. Probably not applicable in this situation since it's already unstable but that would be one way to control such breaking changes in future, coupled with the inspec
 
6:58 PM
@Vogel612 this wasn't aimed at @Mat'sMug, was it? ;)
 
~cough, ~blush no totally not
 
lol
 
> @bclothier - That's basically what I meant by "I think ultimately it should come down to a design decision as to whether to replace a specific interface member of a native object or set up an entirely managed dummy interface". RD shouldn't be in the position of determining the best methodology for test implementation - that is the domain of the test writer. What RD can do is offer a tool-set for the test writer to choose from. If the system under test only calls one method on an interface
 
7:14 PM
OK, @Mat'sMug, what's up here?
 
@Hosch250 where?
 
A procedural module with a declaration type of Project!?
The only ctor for PM's that sets the declaration type does set it to PM.
The other three ctors all call that one...
 
@FreeMan, May I ask you a quick .SpecialCells(xlCellTypeVisible) question?
 
@Hosch250 uh....... o_O
 
O_o
 
7:18 PM
O_O
 
( ) _ ( )
 
#_#
 
(>o o)> <(o o<)
 
Or, the ultimate: x_x
 
@Comintern, may I bug you for a second?
 
7:22 PM
@puzzlepiece87 Odd choice of words on a coding site - you could "debug" me for a second...
 
:P
What am I doing wrong, or is this a quirk of specialcells?
I have a range with 10,000 rows, and a filter that has hidden rows 2,000-8,999
                Long1 = .Range("B" & .Rows.Count).End(xlUp).Row
                .Range(.Cells(1, 1), .Cells(Long1, 2)).AutoFilter Field:=2, Operator:=xlFilterNoFill
                Set Range1 = .Range(.Cells(1, 2), .Cells(Long1, 2)).SpecialCells(xlCellTypeVisible)
                arrRangeToArray = Range1
                MsgBox UBound(arrRangeToArray, 1)
But the msgbox result for that is 1,000, not 2,000 as I was expecting
It's only getting the first visible portion and not the second portion
Excuse me, I messed up my fake numbers there
 
I'd have to check, but I'm pretty sure that when you have a Range with non-contiguous areas .Value only returns the first area.
 
@puzzlepiece87 ^ I'm nearly positive that's it.
 
Ah okay, thank you!
 
If you want for both you have to loop over ever area as well.
 
7:27 PM
@IvenBach Typo?
I'm not quite with you?
"Loop over every area as well?" --> if so, do you mean loop over each visible area, or?
 
It would be over each area that's visible.
 
Is there an easier way to do that, or would the easiest way be to repeatedly refilter and re-range at the first hidden row from the previous range?
Oh, I wouldn't need to refilter?
Is there a way that I can write a boolean for the .Hidden property to the array without doing 10,000 spreadsheet reads?
 
Ah, they were all displaying "Project" in the debugger because of that attribute.
I just removed the attribute, and they all work right now.
 
@puzzlepiece87 I'm setting up your example and may have a solution.
 
@IvenBach Thanks!
 
7:37 PM
@Mat'sMug This is a bit of a pain...
If we insert something next to a token, it gets added to that token.
So, if I then remove that token, the addition gets removed too.
 
Public Sub puzzlePiecesMissingPiece()
    Dim long1 As Long
    Dim range1 As Range
    Dim arrRangeToArray As Variant
    With ActiveSheet
        long1 = .Range("B" & .Rows.Count).End(xlUp).Row

        Dim filterRange As Range
        Set filterRange = .Range(.Cells(1, 1), .Cells(long1, 2))
        filterRange.AutoFilter Field:=2, Operator:=xlFilterNoFill

        Set range1 = filterRange.SpecialCells(xlCellTypeVisible) 'Includes the header
        Dim subRange As Range
        For Each subRange In range1.Areas
I'm pretty sure that's what you were asking for.
That example is still rough. It can and should be refactored.
@puzzlepiece87 I'll help if you need some more assistance.
 
@Hosch250 hmm it adds it to the token we insert before/at?
 
Yeah.
So, if I go:
 rewriter.InsertAfter(target.Context.Stop.TokenIndex, content);
Then:
rewriter.Remove(target.Context);
poof
 
and when would you want to do that and what's the stop token involved exactly?
 
It is in Encapsulate.
So, if we have:
Dim foo, _
       bar, _
       drat
We can then remove bar, replace it with a private field ("Private bar As Variant"), then add the property after it.
 
7:47 PM
Ok
 
@IvenBach Thank you very much! I just read the .areas documentation - I've never used them before. The documentation didn't seem to make clear how an area is determined. Is it based on visibility, or....?
 
What's the problem then?
 
Hmm, I have an idea.
@Mat'sMug Well, I have to do an add and remove with the field.
A replace simply doesn't work for obvious reasons.
 
I'm missing something here
 
And in certain circumstances, the property happens to be included in that token and gets killed too.
Hang on, I have an idea.
 
7:50 PM
Oh because you make it a Private bar so it needs to be removed from the Dim statement first, gotcha
 
@puzzlepiece87 AFAIK (as far as I know) it's when you have any non-contiguous ranges.
 
Perfect, thank you!
 
@Hosch250 Nice pointers...
 
Implementing
 
your original range is a singular contiguous (continually connected) group of cells. When you filter it and then use specialcellsthat is when you get a non-contiguous selection.
 
7:56 PM
@puzzlepiece87 Not sure I'll have the right answer for ya', but ask away!
 
@puzzlepiece87 You can test it out by using Ctrl when selecting a few cells on your screen. Then in VBE in the Immediate window type selection.areas.count
 
Down to 4 failing tests.
 
@FreeMan I think I sniped your question already.
 
@IvenBach Yeah, I noticed I was late to the party. Story of my life... :(
 
@Hosch250 awesome! note that I marked one as ignored, that seemed to enter an infinite loop or something
 
7:59 PM
@FreeMan I've a feeling that me & @puzzlepiece87 are doing similar things in Excel that just shouldn't be done...
 

« first day (1015 days earlier)      last day (2165 days later) »