-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VCS 4.0.34: Unhandled error in clsDbVbeReference.GetDictionary line 162 #495
Comments
Can I also just take a moment to praise the maintainers @joyfullservice and I'm sure countless others who have contributed to this project over the years. I'm a newcomer to Access/VBA and I'm taking over the maintenance of a large and ancient project. I can't say how relieved I was to find this kind of tool exists, since the 'version control' on the project I have inherited has nearly 1000 different .mdb files of different ages. Hopefully I will be able to delve into the history in a more meaningful way using this tool plus |
Is it possible that a reference is broken (missing reference)? |
Ah yes I think that is likely. I have had many problems with missing references in this file. |
@HughWarrington - Thank you for the kind words! That is exactly the kind of scenario where I find this tool so helpful. You can go through each of those mdbs and export the source files, then use WinMerge or other tools to compare the differences between the versions. Another quick tip on the VBA development side, if you haven't already done so, is to set a couple options in your VBA IDE. These tweaks greatly improve the development experience in VBA. (Note that depending on the style of the original developers in your project, requiring variable declaration may be a phased approach if they were not in the habit of declaring them in the VBA code.) |
That's great, thanks for the tips! I suppose a good improvement here might be to print a warning message 'You have a missing reference' or maybe just to silently ignore it -- if I'm honest I don't know yet what this GetDictionary code is trying to do. Perhaps I will have time to contribute a fix myself in due course. |
Warning the user if broken references are encountered, or VBA errors triggered during the export. #495
I have added some additional error handling around broken references. A broken reference does not necessarily mean the export will fail, but it is good to warn the user in case they are not already aware of it. In my testing, a broken reference does not always generate an error either, so I added handling for both cases just to make sure it gets visibility. |
ref.Name will fail if broken ref from a type lib.
Code can also be designed a little more beautifully, I just wanted to show a possible solution. ;) |
Referencing the name property on a broken typelib reference will cause an error. Avoid this condition by testing IsBroken before referencing the name property. #495
Thanks for the suggestion! I have refactored the code to avoid referencing the |
Test with tlb is simple:
|
Good point... I forgot about the fact that VBA will evaluate all the expressions in a function. I will adjust that. 🤦 |
We don't want the .Name property to be accessed on a broken type lib reference. #495
This was while doing my first full export. Right after these initial log messages:
it said
ERROR: Unhandled error found before 'On Error' directive
(from memory). I then reran with debugging enabled and got this:OS Name: Microsoft Windows 10 Pro (10.0.19045 Build 19045) 64-bit
VCS version: 4.0.34
Office version: Microsoft® Access® for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20124) 64-bit
I'm new to Access/VBA but can supply more details if needed.
The text was updated successfully, but these errors were encountered: