Boolean examples postem above with `Not` blowed my mind firstly. But it seems it is just counterintuitive operators precedence problem if I understand correctly. ``` ?Not False = Not 1 True ?(Not False) = (Not 1) False ?Not (False = Not 1) True ```
Write own error handling classes, extensibility library wrapper, modules parser for a few days. And after a lot of sweat, pain and tears buy vbwatchdog finally. My true story... ;)
Just discovered twinBasic thanks to last post on RD blog. Incredible...! The only thing I am a bit disappointed is I cannot test own dll's (unfortunately Office x64 here) :(
Hello! Is it possible in Rubberduck to define own autocompletion rules? I mean somethin like: type "pubf", hit enter and I have "Public Function ()" in a result (example like in PHPstorm). Thanks
Is there any known 'hack' to change colors in Code Explorer pane (and maybe Properties, Locals)? I am not asking to inverting colors in entire system. I have pretty dark theme in main code window, but this white-backgrounded panes next to it make me sad...
(Today I made first first full interface-based solution in VBA for my client. I was soooo surprised when it worked after 2 hours coding and a few minutes of debugging :D like Mathieu wrote once propably on the blog- OOP is a rabbit hole and I want to go deeper into this :D)
:) Maybe full-fledged... Simple task just to paste table from Excel to Word (template file) bookmark using .PasteExcelTable method, delete table in before next iteration and the bookmark is gone somewhere deleted... So simple work but seems so counter-intuitive for me in Word
My example above was wrong, the test was on empty 'not initialized' table (.ListRows.Count =0 and the comparision was Nothing=Nothing). Nevermind, it's just mysterious implementation of Range. Have a nice weekend!
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
"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.
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
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?
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's quite strange that on the same Windows+Office settings the same implicit conversion can result in two differents strings. One more reason that implicit conversion is evil. Regards!
Just a little fun fact about my question about implicit conversion: when assigning Bool variable to String variable, it seems that another algoritm is used than implemented in VBA.Cstr and can result in regional name (from Windows Regional Settings?). For example False bool value can eval into strings "Falsch" (german) or "Fałsz"(polish) ect instead of just "False".
This type of casting seems be undocumented and may results in using Windows Regional Settings names like "Falsch" in German or "Fałsz" in Polish language. When using CStr the result is always predictible and results in "True"/"False" word.
If someone have something interesting to add to my little 'bounty' on SO feel free stackoverflow.com/questions/46565072/… it is about implicit conversions in VBA and I am interested especially what happend when you assign bool to string type variable. Most discussion's part is in comments.
Haha! I've supposed that it is something with def value! Thanks a lot! I read every rubberduck news multiple times. Even my wife is sometimes angry of me becasue of that! :)
But why I need to use empty brackets to reference to first or second cell in the object such in example above [a4:a5]()(1) works and [a4:a5](1) - compile error
Hi! I've just saw quite strange code for me - a reference to a cell in evaluated range: [a4:a5]()(1). Without empty parantheses [a4:a5](1) there is a syntax error (wrong number of arguments or invalid property assigment). What does really empty round brackets () do in this case? If the answer isn't obvious I would ask on SO. Thanks
@MathieuGuindon Incredible, I've read the article few days ago and didn't realise that I can use Sync Project as a solution for that problem. Thanks a lot! :)
Is any working "VBA decompiler" for Office x64 bit? For a some of my clients I must use full qualification e.g. VBA.Len insted Len, Dim coll As VBA.Collection instead Dim coll As Collection etc. If I use VBA methods without "VBA." it throws compile error on some PCs. I've read it's a know issue and "decompiling" is an option. Thanks!
Yes, you're right :) @FreeMan gave me some idea- I would export entire project to my Library "real" hard drive folder with VCS implemented. I just read that .gitignore can be set "reverse" to ignore all files except given list, so I would set the list of my Library classes. And add some code to clean the folder from project-linded files using powershell or other automatic script. If it would be an option to export one RD "folder", it would be more simple, but thanks for all above sugestions
My Library almost 100% vanilla VBA, because performance for me is on the second place, the reliable working is priority. I send my files and should work without any additional work except enabling macros (and no trust VBA Project Object Model changes).
@Freeflow I thought about this. But without external reference I found things simplier. Some of my Excel workbooks are used by 30 people, I would not to use TeamViever to set the references on each PC... I even use late binding to avoid problems with e.g. Word library versions.
I know my workflow isn't best, I am still learning to become programmer. When I start new project first thing for me is to import my Library classes to project (newest version from hard drive). While working on project I often get an idea to add new useful method to one or few my Library's class, or just fix something. So I make changes in the class in current project, and after all I export entire project, later choose library classes to overwrite previous version on hard drive.
So unfortunatelly it's not possible at the time. My library is still growing, it contains about 20 classes, a few interfaces (due separate classes for Windows and Mac in some cases), and few userforms. I often make changes to my Library while working on specific project, so exporting entire project is mixing my library files with other current-project classes and modules. Maybe in the future :) thanks for the answer
Hello! :) Is it possible to select in RD Code Explorer specific "folder" and export only classes in that folder to .cls and .frm files? I am building my own multiplatform VBA library, and it would help me a lot. I only see built in export single class method and RD option to export entire project.