« first day (1056 days earlier)      last day (2124 days later) » 
00:00 - 18:0018:00 - 00:00

12:00 AM
RELOAD!
[retailcoder/Rubberduck] 21 commits. 13738 additions. 13047 deletions.
[rubberduck-vba/Rubberduck] 1 opened issue. 5 issue comments.
 
Home Time!
 
1:06 AM
Do you agree with my thinking that Powershell does support functional programming ? @Hosch250
 
Possibly. I've barely used PS.
 
1:33 AM
This might be a question for SO (or just some Googling), but I want to build a C# solution that exposes an API for scraping a known set of webpages, but also has a VSTO UI layer (which will sit atop the same API). Ideally the API would also be COMVisible so that VBA users can leverage the API.
 
@PeterMTaylor the pipe operator definitely feels like it indeed
 
what would that solution architecture look like?
 
for a VSTO add-in?
 
is that a question or a suggestion?
 
lol
a question :)
 
1:38 AM
yeah, I want a RibbonUI that is easily installed, so I think that means VSTO add-in.
but if I want VBA to also be able to interact with the API, I think that means a COM-exposed class library, or can VBA interact with the VSTO add-in?
 
you need a COM API I'd think.
like RD
you make a dedicated namespace for the COM API that VBA can reference. or you make a separate COM-visible assembly for it
 
eg. Ribbon would have a button for launching a data retrieval wizard. User selects the desired entity and date. VSTO goes and retrieves the data and dumps in the cell specified by the user. Same thing would be exposed to VBA - Create a new request with a given entityID and date, and the API would retrieve the data and return it to VBA.
 
so you just do your thing, and then wrap it up for VBA consumption
I mean wrap quite literally here
 
OK, but I still need the VSTO add-in, to work with the ribbon?
 
yep
you could have a "core" class library with all your functionality, then the VSTO add-in that calls into it, and then the VBA API that calls into it too
 
1:48 AM
So solution is VSTO add-in and Class Library, where the class library has a COMVisible namespace, or a VSTO add-in, core Class Library, and a COMVisible Class Library? The latter would let me deploy the VSTO/Ribbon solution without requiring all users to have the COM add-in?
 
I think a VSTO add-in needs to be COM visible, so you'll want to only expose the stuff Office needs to work with it. But if the core library is also the VBA API, then VSTO clients will require that library to be installed anyway
in a 3-assembly setup you could deploy just the VBA API, or just the VSTO add-in, or both
 
2:18 AM
@IvenBach To clarify what I said earlier, I want you to write a short program with each of those operators except the ones that need to be used with the fixed statement.
Once you are done, I'll quiz you on a few things, including the precedence.
 
2:46 AM
Or use Join$ and get a free type hint, while stocks last. Actually, don't do that. — ThunderFrame 8 secs ago
2
 
lol
 
3:07 AM
@Hosch250 It'll take me some time to get through all the reading but I'm working on it.
 
3:36 AM
I'm working on this right now:
OK, SE, fulfill your promise.
You said it would onebox.
Wasn't that supposed to be last Friday? Or is it this Friday?
 
ask Craver?
 
You can, if you like. I'm not a fan of his.
I'll just go read the blog again.
 
TTGTB
 
See you.
 
4:10 AM
[retailcoder/Rubberduck] retailcoder pushed commit 3f78fa11 to rd-next: renamed IMemberContext and IChildContext to IAnnotatedContext and IAnnotatingContext, respectively.
[retailcoder/Rubberduck] retailcoder pushed commit 0ec5a54e to rd-next: annotated context is now responsible for knowing token index to insert an annotation at.
 
</mug>
 
4:44 AM
Regarding LINQ should I concern myself with understanding the difference between cross-join an non-equijoin queries?
 
Not yet.
Eventually, yes.
Linq is quite a bit different than much of the rest of C#, so just do it with loops and ifs for now.
I'll show you how to use Linq gradually as we go along.
Right now, you are probably ready to start using collection.Any() instead of collection.Count > 0.
And collection.First() instead of collection[0].
And collection.Last() instead of collection[collection.Count - 1].
Once you are ready for lambdas, I'll show you the fancier versions of those, and Where and Select.
Oh, you can use ToList() too.
 
I started reading up on LINQ a couple days ago and am finishing up with the from clauses
 
 
2 hours later…
6:34 AM
@Hosch250 on the Typeof operator
I'm going slow making sure to understand what's presented in the examples before moving on to the next.
 
6:57 AM
> Wow. I wasn't expecting such a detailed response. As for as I an see there are no continuations in that Module, I've attached a trace level log for your information. The reason I've reported here is because I think the Resolver error is stopping access to code inspection because the code inspection window is empty when I open it. As a very novice and amateur coder I wouldn't expect to have absolutely no issues in my code.

[RubberduckLog.txt](https://github.com/rubberduck-vba/Rubberduck
 
 
1 hour later…
Kaz
8:17 AM
@Mat'sMug Nothing I could discern.
And it's gone back to working normally now.
 
 
6 hours later…
1:54 PM
@IvenBach For that one, look up the relationship between it and GetType().
 
Stupid beginner question, but is there any simple way to replace multiple characters in a string with multiple new characters? I tried something like newstring = oldstring.replace([":', @"/", "%20"], ["", "\", " "]) but this didn't work
C# by the way
 
2:11 PM
I don't see how that is supposed to work...
You can do .Replace(char, char) or .Replace(string, string).
So, this will work:
 
I wasnt sure if it was possible to do something like that where you input value pairs through an arrray. I searched more through SO and it seems like the only real option is to just use multiple calls to replace.
 
old.Replace(":", "").Replace('/', '\\').Replace("%20", " ")
You have to use a string on the first one because there isn't an empty character.
Got an interview in 15 minutes.
 
0
Q: SQL to list function - turning a table column into a delimited list string

iDevlopI wrote this very "general use" function, because I needed that in some reporting. I was windering if there is any suggetsion for improvement. Function sql2List(sSql As String, Optional quote As String, Optional separ As String = ", ") As String Static db As DAO.Database Dim rs As DAO.Re...

 
Oh nice, I didnt know I could just chain them togfether like that
 
Yep, immutability really lends itself to that pattern.
That is my favorite feature of F#--almost everything returns something, so you can just pipe multiple calls together.
 
2:17 PM
Good to know for the future
 
aye, strings are immutable in .net
and they're a reference type, i.e. a class/object, not a value type. that's part of what makes strings a bit confusing when you're starting to learn .net: they're objects that behave like values
..and yet, even value types are objects in .net
..which makes things even more confusing :)
 
I like the functionality of C# in that way so far though. It is pretty handy to get intellisense on a string, and to call methods on a string instead of providing strings to functions.
 
wait until you get to extension methods :-)
imagine this (illegal) VBA code:
 
Yeah, those are nice, but you usually don't use them, TBH.
Or rather, usually don't write them. You use them plenty with Linq.
 
Public Sub Clear(Me items As Collections)
    Do Until items.Count = 0 : items.Remove 1 : Loop
End Sub
and then you could do
myCollection.Clear
extension methods extend types you don't own and can't modify
so yeah, they're normally pretty rare
until you get to work against a 3rd-party API that's hopelessly under-featured
cough VBIDE cough
 
2:32 PM
I am still at the bare basics of getting C# to open a workbook and close it lol
I am nowhere near that kind of stuff
 
oh, COM interop is far from "bare basics" ;-)
make sure you verify task manager and kill any lingering EXCEL.EXE processes
 
All I did was add a reference, declare some variables, and then use the methods I know lol
I do Excel.Quit if Excel.Workbooks.Count <> 0
(before I open the workbook of course)
 
yeah. still, verify in task manager.
 
OH DAMN
5
user image
2
 
every single COM object you instantiate gets a RCW (runtime callable wrapper), and the mechanics are quite complicated, but basically if you don't release these objects, your Excel instance remains alive
 
2:35 PM
Why?
How do I fix that? Set it to nothing?
 
Marshal.ReleaseComObject(foo);
 
What's the reference for marshal?
It isnt coming up
 
beware of the "two-dot" issue: if you do excel.Workbooks.Count then you're dereferencing Excel.Application and Excel.Workbooks to get the .Count
it's under System.Runtime.InteropServices
welcome to COM interop
 
Fun...
lol
 
now hopefully that gives you a new perspective on Rubberduck crashes and not-so-clean exits :)
 
2:39 PM
excel isn't a valid argument for Release. I am guessing I need a process ID of sorts?
 
you need an object
 
I declare excel as a Application
 
oh
it's case-sensitive
Excel would be the namespace, excel would be your variable/object
 
I know, I have it as excel :0
:)*
I am at least not that bare-basics
It cant convert to System.IntPtr
 
huh wait a minute
Marshal.ReleaseComObject, right?
Marshal.Release takes an IntPtr; Marshal.ReleaseComObject takes an object
 
2:43 PM
Oh crap, my bad. I just did Marshal.Release
 
so you'll have to release every single COM object you ever access (that includes every single cell/range, sheet, worksheets collection, everything)
 
....And why am I doing this?
2
 
forget one single object and the EXCEL.EXE process won't shut down
because COM is reference-counted
 
The best approach would be to use a collection of some kind then right?
Or a class?
 
not sure what you mean
var excel = new Excel.Application();
// do stuff
Marshal.ReleaseComObject(excel);
 
2:50 PM
For example, if I instantiate a bunch of interop objects, what is the best way to keep track of them to ensure they are released after? I tend to forget things, and I wil undoubtedly forget to release an object if I am simply relying on adding it to the end of my code.
 
keep methods small & focused
var excel = new Excel.Application();
DoStuff(excel);
Marshal.ReleaseComObject(excel);
 
Fair enough. That'll be new
 
basically anything that's responsible for creating an object is also responsible for destroying it
4
 
Itll be a good habit to learn though
 
indeed. and then when you get to IDisposable you'll appreciate how .net makes this dead-simple!
using (var foo = new SomeManagedDisposableObject())
{
    // do stuff
}
2
^ shorthand for:
var foo = new SomeManagedDisposableObject();
try
{
    // do stuff
}
finally
{
    foo.Dispose();
}
 
2:56 PM
interesting
 
note you'll want to release your COM objects even when an exception occurs and your app blows up
so yeah, starting C# with COM interop isn't exactly the easy way ;-)
2
 
Yeah, it isnt the easy way, but it is applicable to what I do. Besides, I dont think I have the patience for any more "Hello World" applications
 
@BrandonBarney Print "Hello World" without using strings, characters, or integers.
 
On a console app? Is that even possible?
 
No idea. Open problem.
 
3:00 PM
lol
 
Bonus if you do it in a console app without using any Console functions.
 
The best I can think of is get a bunch of images and combine them together
So I would either need a bunch of icons, or a collection of readily available images
 
And writing to file in the console app doesn't count.
@BrandonBarney Well, I guess that works. I was intending the output to be text, but...
 
What if I draw in the console?
 
That's more like what I was thinking.
 
3:05 PM
I might give that a shot at some point if I get bored, but if I tell my boss "I was learning how to draw pictures in C#" he might question whether this is actually professional dev or not lol.
 
meh.. Code Golf & puzzles are fun, but they're of limited practical value IMO
99% of what you'd do in a golfed application can get you stabbed if done in real production code
 
@Mat'sMug I would hardly call this golfed.
 
> Print "Hello World" without using strings, characters, or integers.
Sounds like a plausible PPCG post to me
 
A golfing puzzle is where you write it in as few characters as possible.
 
3:12 PM
 
This is just an ordinary code puzzle.
 
right, whatever. same thing. arbitrary constraints that never happen IRL
 
It can be educational.
Oh, the company I interviewed at is already on C# 7.
 
Nice! I hope things work out!
 
So what is the issue with excel.Workbooks.Count again?
 
3:15 PM
You're dereferencing a Workbooks object
 
What does that mean?
 
Means excel.Workbooks is returning a COM object
 
Oh wait, so I am not getting the workbooks collection, I am just getting a workbook object?
 
and you're not keeping it around, so the managed object is eligible for garbage-collected as gen1 as soon as the instruction ends, but the RCW won't get released
The workbooks collection is an object too
 
So how do I properly get the count of open workbooks?
 
3:17 PM
var books = excel.Workbooks;
and then you can release books when you're done with it
 
So essentially, any time I need to go downwards in a hierarchy by more than one, I should be setting a variable for it?
 
yup
 
Oh joy
 
yyyyuuuuup
every. single. COM object.
 
I'm just gonna add a 'Please restart your machine when you are finished.' prompt
3
:p
 
3:19 PM
ouch
 
Nah, I wont lol
 
put your code up for peer review on CR once it works as intended - you'll get good tips for cleaning things up
 
I will once I make an app I actually intend to use. For now I am just messing around
I might make it something usable for my daily work, but thats if I can get a better handle of things
excel.Workbooks will update as workbooks are added right? It is a pointer to the Workbooks collection and not just a static copy?
 
yeah it will - it's the same object pointer
 
Ok good
It actually wasnt too difficult to wrap everything in such a way that all the objects were released. I just made a separate method for getting the count, and refactored to encapsulate what I could.
 
3:32 PM
:+1:
the messier part is to ensure everything cleans up nicely when any COM call throws an exception
2
 
And that will happen.
 
I currently am catching the only places I can foresee an exception being thrown, but I will definitely keep that in mind
 
@BrandonBarney It's not stupid. You're actively trying to learn and putting in effort on your part.
 
@BrandonBarney Catch as few as possible. The sooner you know about a problem, the better.
 
Are PivotFields/PivotItems objects that will have to be declared and released as well?
 
3:48 PM
yep
individual cells too
 
@IvenBach Well, he could have put in a little more effort and found the answer himself on SO and MSDN ;)
 
and fonts, formats and borders
 
So I have to create a holder for every single time I edit a PivotTable...thats like the #1 thing my macros do lol
And ListObjects
 
everything that's an instance of anything in the Microsoft.Excel.Interop namespace
 
@Hosch250 Sometimes one doesn't have enough knowledge to know what, or even how to ask for help. It's rough getting started.
 
3:49 PM
@IvenBach string.Replace in any search engine is enough.
 
In all fairness, I couldve searched a bit more thoroughly, but I started with passing multiple params to a method and I didnt get any results I understood before asking
While waiting, I did find SO askers who said that multi-line Replace was the only option in the end
I wouldnt have found the chaining idea on my own
 
@BrandonBarney Talking about that, one thing:
 
Whenever you use a string function, you have to assign it. Just calling oldString.Replace() doesn't change oldString, it returns a new, changed one.
That caught me out a couple times.
 
Yeah, I was aware. I currently have it as something like filepath = filepath.Replace.Replace.Replace
 
3:51 PM
@Hosch250 Took me too long to understand that...
 
It did get me at first though
And then when I wrote it to console I figured it out
 
that's what "strings are immutable" means :)
 
Duh Check: for properties IE Public Property Let foo(bar as mook) is it convention to pass ByVal?
I'm having a brain-fart moment.
 
for anything that doesn't need to be ByRef the default should be ByVal
 
And yet VBA-Landia has it the other way around.
 
4:02 PM
yeah. VB.NET fixed that.
 
Code Inspections finally worked and I'm cleaning up all the issues.
Duh Check: ByRef should be used if it's assigned within the method.
 
Well, we have an inspection for that.
 
Public Sub Foo(bar as string)
    bar = "some other Bar"
end sub
 
If it is a sub, though, maybe you should make it a function.
Yeah, just return that value...
 
Kaz
TIL that not everyone has Excel 2016...
 
4:07 PM
But if you have...
 
@Kaz LOL.
I still have 2010 and 2013 available.
 
Public sub Foo(bar as string)
    ws1.range("A1").value2 = bar
end sub
 
Pretty sure I have 2013 on my work computer
 
Then bar isn't assigned.
 
4:07 PM
That would be ByVal?
 
Yeah.
 
But imagine my surprise when I learned that some of my coworkers have 32 bit
 
:+1: thanks for that @Hosch250
 
@BrandonBarney LOL, that's still the recommended version.
 
Kaz
@Hosch250 Today I was also reminded that while 2010 has nearly everything that 2016 does, there are some things it does not.
 
4:08 PM
Or was not so long ago.
@Kaz Yup.
 
Kaz
In this particular case, NUMBERVALUE()
 
Excel actually got a few big new features recently.
 
@Kaz I'm on 2013
Isn't Textjoin one of them?
 
I'm running Office 2010
 
Do I have to check for null before releasing?
 
4:11 PM
ideally, yes
otherwise Marshal.ReleaseComObject will throw
#GetsDirtyQuiteFastDoesntIt
 
If you write an extension method Release, you can do instance?.Release().
 
Is there a ComObject type I can use then to create the method?
 
^ assuming C# 6.0
 
Cause var isnt showing up
 
huh?
var is just a keyword
 
4:13 PM
Isnt it a variable type?
If it isnt, a tutorial lied to me
 
No...
 
It tells it to use the type inference system to find the variable.
int i = 0;  // explicitly say what it is
var i = 0;  // C# knows because `0` is an `int`
Both of those are still ints.
 
that makes more sense
Ill just write out a null check for now and figure out a function for it later
 
4:27 PM
@IvenBach I've been assigning stuff outside of the method doing functions. Am I not doing it right?
Hypothetical example: strBeingWorkedOn = ReplaceStr(strBeingWorkedOn)
Should I just be passing byref instead?
So just: ReplaceStr(strBeingWorkedOn) where strBeingWorkedOn is passed ByRef and now has the same new value it would under my previous technique?
Is either fine or is one better?
@BrandonBarney My work has imgur blocked, but how many instances of Excel did you have? :D
 
like 7 or 8 I think
 
I think I just counted 11.
 
Oh, even worse lol
 
Hahaha, just some stress testing, nothing to see here lol.
 
lol
Why can't I use [] to index the PivotTables type?
 
4:32 PM
It is probably an IEnumerable.
 
@puzzlepiece87 If I'm understanding it completely I'd go with this one. That way you know that something is being assigned. Otherwise with just ReplaceStr(strBeingWorkedOn) it's ambiguous as to what's occuring. Unless you examine ReplaceStr
 
How do i find out? And how do i then get the pivottable I need if it is?
 
You can either enumerate it to a list .ToList() or use .ElementAt(). Both of these need you to reference System.Linq.
@BrandonBarney Hovering over it will tell you the type.
 
@IvenBach Great, thanks for telling me the principle and not just which is better.
@IvenBach But how should I understand that against your earlier comment?
 
It is telling me the type is PivotTables (I declared it) but it isnt saying if it is enumerable or not
 
4:34 PM
MSDN tells you that :)
 
@Mat'sMug I continued reading up on using parameters with In and Like Any. Do you have any warnings before I start refactoring for queries that could be passing 20,000 items? I saw there's a limit of 2,100 items for stored procedures - I'm thankfully not planning on using those.
 
actually PivotTables would be a non-generic IEnumerable, so if you want to use the generic IEnumerable<T> extensions you need to cast its elements; do pivotTables.Cast<PivotTable>() and then you get an IEnumerable<PivotTable> to play with - but beware of the dereferenced COM objects - Cast<PivotTable>() iterated every item, so you've got a RCW got as many COM objects... better stay away from LINQ with COM interop.
 
> It's Part of VBA.Strings. I can't remember if this was already logged.
 
@Mat'sMug In addition, I was idly considering passing all 20,000 items in each of the 20,000 parameters, since SQL Server considers in (1,2,3) to be the same as in (1,2,3, 1,2,3, 1,2,3). This is a terrible idea, right?
 
@puzzlepiece87 wait you have a list of 20K items you want to use in a SQL WHERE/IN clause????
that's completely abusing IN!
get these 20K items in a table and use an INNER JOIN instead
 
4:39 PM
@Mat'sMug Oops sorry.
I was halfway to your solution but not quite.
The paraphrased command is select claimid into #TempTable from Claims where claimid in ()
 
@Duga yup, repro here
 
@Mat'sMug Glad I'm not the only one.
 
So you're saying I should rework that into creating the table from scratch from the claim numbers I know rather than doing Select into.
 
@puzzlepiece87 where in works best with < 10 items. more than that, you get the criteria into a table and do a join instead
 
@Mat'sMug Thanks for beating out the bad habits.
Okay, I will go learn more about CTEs (not sure if they apply here but I need to know more anyway)
And then I will rework my query to avoid abusing In
 
4:42 PM
CTE's are basically your normal sub-queries, only extracted out of the FROM clause
 
Oh
And obviously this method solves my parameter problem, for SQL Server, for now. I may have to revisit as I make sure Teradata and Oracle are still covered (they work using my abusive methods basically).
 
so instead of select foo from (select foo, bar from abc) a you do with a as (select foo, bar from abc) select foo from a
 
@puzzlepiece87 I'm trying to come up with a good example for you but it may take some time.
 
@IvenBach No rush or pressure, thank you.
 
I use it often but my case my be not applicable to you.
I'll try and come up with one before lunch.
 
4:44 PM
@Mat'sMug That's clear, thanks, though I will read more to remember/understand why you find those better than Select * into #Temptable
@Mat'sMug Thanks again for pointing out my issues with multiple parameters in In clauses yesterday, you saved me hours of frustration.
 
20K items in an IN clause is certainly a performance killer. even on an inner join it's not ideal to compare with varchar keys - if possible use an int primary key to get SQL Server to do a simple clustered index scan. then performance will be optimal
@puzzlepiece87 CTE's are nice when you need calculated fields, e.g. ExtCost = Units * CostPrice. And they can be recursive, too.. but I never needed to use a recursive one. But it's pretty cool, and kicks MySQL's @$$
 
@Mat'sMug Okay, I will examine the table and see if there's an int primary key and figure out how I would use it well.
@Mat'sMug Good to know, thank you.
 
@Duga something tells me Strings.Space isn't exactly Strings.Space
VBA... [bad] surprises every day
 
5:09 PM
@puzzlepiece87 The example I can come up with is poorly contrived, and not pretty.
Option Explicit

Private Enum WhichSheet
    NorthAmerica
    Europe
    Elsewhere
End Enum

Private Enum ListToUse
    Consumers
    Vendors
    Shippers
End Enum

Private Enum InternationalShippers
    DHL
    RoyalAir
    ICantThinkOfAnother
End Enum

Public Sub FillInShippingInfo()
    Dim useList As ListToUse
    Dim listResult As Variant
    listResult = GetTheUseList(NorthAmerica, Consumers)
    ActiveSheet.Range("A1").Resize(ColumnSize:=UBound(listResult) + 1) = listResult
End Sub

Private Function GetTheUseList(ByVal ws As WhichSheet, ByVal list As ListToUse) As Variant
If that's too confusing I'll try and articulate better after I get some lunch.
 
@IvenBach missing Case Else: Err.Raise 5 in that Select Case block
remember enums are just named constants
ws could be any Long integer value
> but I'm passing NorthAmerica
and the GetTheUseList shouldn't assume that it's getting a value that's defined in the enum type
#JustSayin
 
You are correct.
 
5:30 PM
@IvenBach Am I characterizing it accurately if I said it looks like you are using ByRef here primarily as a way to conveniently return two values from a function?
 
Yep.
 
Is that a bad thing? Cause if so...ill be back after I fix every project I have written in the past few months
 
I don't think so.
 
I'm not a good person to ask that question - I do stuff all the time because it's convenient and nominally works.
 
I have to do lots of criteria checking on a triad of cells.
 
5:33 PM
I literally have just been using functions to tell me if there is an error or not, and I return the objects I need using ByRef
 
If it's a singular item that's being returned I'd say a function is better.
 
If I had to guess, I would say it's nominally not ideal because it breaks encapsulation, right? A variable's value is being changed directly in separate pieces of code.
But again, you're talking to a guy who uses a Sub Cancel() that terminates with End.
 
I do the same thing if I cant handle the error internally lol
 
Don't tell @Mat'sMug, he thinks you're awesome right now but he'll dock you points for that.
 
^
 
5:36 PM
lol
I mean...I never use End. That'd be insane.
 
I'm so far in the negative it's depressing.
 
Who would do that?
 
cough
People that don't know any better?
I did that for a long time.
 
Yeah I dont blame you lol
When I first started I used GoTo instead of If blocks at times
But it wasnt out of laziness, i just thought that was what they were for.
 
I do it now because I'm too lazy to bubble stuff up for situations when I know I want to kick the user out of code.
 
5:38 PM
Let's not talk about past sins that were committed.
 
I'd say it's something C++ does all the time. It's clearer in C# where ref args are specified as such at the call site, so there's no surprise. Otherwise it's fine... I like naming ByRef parameters with an out prefix to make it clearer though
</lurks>
 
Thanks to @Mat'sMug 's influence, I am bubbling up errors that I want the user to be able to press through or get something more alarming than a Msgbox for.
 
In my case of using End, I only do it if it is an unhandled error. The people I work with have no ability to debug, so it displays a message to them, creates a log file, emails me, then uses end.
So its not like I am just silently ending.
 
You can also wrap up your return values in a type or class, and make a function that returns one object with all the values
 
5:42 PM
I do...kind of... I wrap all the data I am working with into a class, but I pass workbooks and worksheets around using function calls. I clean up, but I have methods for opening, retrieving, and cleaning the data.
So byref is usually used to retrieve the data from a table, and then I put it into a class
If I continue working with VBA though I hope to get better with classes
I hate VBA right now though. I have been debugging this problem for the last half hour, gave up and reverted everything, but suddenly it works on its own now.
Scratch that, its somehow more broken
Or I may just be an idiot
Self.End() . It wasnt broken the entire time. I just forgot that the data I am working with should only be returning one item and I have been trying to figure out why only one item is being returned.
 
Now that my methods are small enough I can copy they body comment it out and below paste to make edits and still see what the old code was.
It has really helped me make changes with more confidence.
 
5:58 PM
What does it mean when someone prefixes a line with a Type within Parentheses, this for example: (Excel.PivotTables)ws.PivotTables(Type.Missing)
 
00:00 - 18:0018:00 - 00:00

« first day (1056 days earlier)      last day (2124 days later) »