Missing Tool References - excel

My version of VBA seems to be missing quite a few Tool References. Therefore I tried adding a library I know exists (scrrun.dll) through the "Browse" tab although it only results in the following error:
I would appreciate any kind of help regarding how to get access to more tool references.

A reinstall may help, but these references may be pointing to a folder from a different version of windows (*\System32 vs *\SysWow64 may be the issue)
What changed from the system it originally ran on? Search the C: drive for SCRRUN.DLL and if the path has changed, switch that via browsing for the real path. I've never seen that file missing before, but I think it's part of Windows.
On a rare occasion, you may have to re-register the components (again some of these are included Windows components). Check out this reference

Related

How can I fix Microsoft Visual C++ 2017 X64 Minimum Runtime error during installing Redistributable packages (VC_redist.x64.exe, VC_redist.x86.exe)?

During installation I get "The feature you are trying to use is on a network resource that is unavailable" and prompt to specify some path to vc_runtimeMinimum_x64.msi. After providing some path to required file I get error states that this file doesn't match required version Minimum Runtime 14.14.26405.
I finally found the solution reading this question: Install vcredist_x64 with VS2017 installer project
I realized that specific VC_Redist.x64.exe files could be downloaded by links like https://aka.ms/vs/15/release/26405.00/VC_Redist.x64.exe, where 26405.00 is exactly the version I was required to fix. Note, that you need version from error text after clicking OK, not from window title.
And the last point is that this exe must be executed from cmd with argument /repair to help me with this issue. Regular execution by double click made no effect.
I found the solution elsewhere. It said to
Fix problems that block programs from being installed or removed
https://support.microsoft.com/en-us/help/17588/windows-fix-problems-that-block-programs-being-installed-or-removed
download troubleshooter button on the link.
Run it - choose option - have problem with installing - it lists programs - choose the missing / problematic visual c++ runtimes in the list
it will run and get fixed.
Repeat for each visual c++ you having problems with. I ran the program multiple times.
I have to thank this comment section for helping me with this problem, since I have not been able to work more efficently with my school, since I din't know what and if a single file somewhere deep down in the computer had to be deleted for this program to work.

What causes 'can't find project or library error' and how to prevent it from happening?

I'm having an issue with tool I developed in excel for one of our offices. It is a big enough file with couple of macros in it, but it works smooth day to day.
However every few days file will through error 'Can't find project or library' and file will crash. I know the standard guides are that when this error appears, it is to go to vba>tools>referneces and uncheck the missing library, however this is not the case in here. Simply when this happens file crashes and restarts and if it will happen once, every other attempt to open back the file will result in same error in crash. I mean file can be absolutely fine, you will save it, go back to it and error happens. So I always have to recover the file which absolutely destroys it, however I can at least recover from it information uploaded there by the users and copy it into the template.
So 2 questions I have is what is causing this to happen? Both myself and the other office are using the same version of excel so compatibility should not be an issue.
2 questions is is there anything that can be done to prevent this error from happening.
I have exactly this problem. As stated, once the error occurs, it it results in a permanent "unfixable" loop. I use powerquery and linked data and this appears to randomly "damage" the file as described - most frequently when excel crashes for some reason.
I have found either of the following to work:
- Open the file on a different computer that is not on the LAN. This
appears to be a key requirement.
- Open the file with "Excel Online"
In each case, simply open the file and save it with a new name. Move the new file back to the work PC and it will once more open perfectly.
On rare occasions (if powerquery is in use), it is necessary to "refresh all" data connections before saving the new file.
As a bonus, the new file is often smaller than the original.
This worked for me:
In VB go to Tools ยป References
1) Uncheck the library "Crystal Analysis Common Controls 1.0". Or any library.
Just leave these 5 references:
1) Visual Basic For Applications (This is the library that defines the VBA language.)
2) Microsoft Excel Object Library (This defines all of the elements of Excel.)
3) OLE Automation (This specifies the types for linking and embedding documents and for automation of other applications and the "plumbing" of the COM system that Excel uses to communicate with the outside world.)
4) Microsoft Office (This defines things that are common to all Office programs such as Command Bars and Command Bar controls.)
5) Microsoft Forms 2.0 This is required if you are using a User Form. This library defines things like the user form and the controls that you can place on a form.
Then Save.
I've had similar nasty issues.
First thing to do is use the CodeCleaner a free utility from AppsPro
This will export your modules and then re-import them, because internally they get a lot of binary "lint" which can cause problem.
Second thing to suggest is start breaking up your code base. So start removing modules to see which module is the offender. Horrible I know but how can you tell otherwise where the problem is.
Third suggestion is to always fully qualify your functions. So instead of Len(sMyString) write VBA.Len(sMyString) that helps prevent false negative compile errors.

VS2012 Project Reference's Properties' path does not match .vbproj HintPath

My goal was to update a reference from my old DLL to a newer version that was updated to VS2012.
D:\DEV\<old_path>\TEST\bin\Company.dll
D:\DEV\<new_path_2012>\TEST\bin\Company.dll
In the .vbproj file...
<Reference Include="Company, Version=0.0.0.0, Culture=neutral">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\<new_path_2012>\TEST\bin\Company.dll</HintPath>
</Reference>
In the Solution Explorer, Under References, I right-click on the Company reference and click Properties. The Path is listed as...
D:\DEV\<old_path>\TEST\bin\Company.dll
There are no errors or warnings. Everything is appearing to build properly however I lack confidence because of this discrepancy. How can I fix this?
I have tried restarting VS2012 and have tried deleting the TFS Cache. Downloading a fresh copy of this project from TFS on another PC seems to resolve the problem however I would like to better understand how to resolve this without such drastic measures.
I just had this issue crop up, and while this is an old thread it was the first Google result when I did my search, so I thought to offer what had happen for me.
TL;DR: Triple check the hint path - it could be wrong, and VS is using the DLL in the GAC.
My issue came up because I was using a little script to help me update over 250 projects worth of references, and had a small handful that didn't follow normal folder layout. So my hint path was 'correct' at first glance, but because it really wasn't, VS 2013 went to the version of the DLL in the GAC.
Once I clued into what was wrong and fixed the relative path for that project file, hint path and what was displayed in References matched up as it was supposed to.

project references are "lost" after getting latest from TFS

I have a solution with many projects. This is actually a solution that contains a mix of class libraries and various web applications. It seems that if my colleague makes a change to one of the web projects (or if I do) and then check it in. And then when either one of us gets the latest version project references become broken. They still appear in the references section with no indication of an error, but when you try to compile it cannot see the libraries.
To solve this I have to remove the references and add them back in. Any ideas on what may cause this problem?
Make sure that the paths are relocatable, that you both have the same paths on your PCs (i.e. that you have not used TFS workspace mappings to put different folders in different places), and that you don't move projects around or rename folders etc.
Even when everything is clean and tidy, Visual Studio will occasionally decide it can't find a file that's right under its nose, or that a file somewhere else on your system looks prettier, and it will break the reference. You just have to delete and recreate it in this case. But this usually happens once a month in a team of 10-20 people, and should not occur every time you check in.

How do I backup my C++ Builder component installation?

I finally have my C++ Builder 2010 installation the way I want it, with all my components upgraded and installed. (touch wood)
I have been working with C++builder since version 1 and I know from countless previous traumatic experiences that this state of affairs could change in an instant. I would like to backup the installation and component set.
Is there a way to do this? A tool perhaps? A menu command that I have maybe missed all these years? I don't want to have to reinstall all the components from the bpl source again.
I make nightly backup images of my entire drive, I would like to do this for c++builder only if possible.
If it's a matter of simply copying files, which files would I need to copy? Are there entries in the registry that would need to be restored?
Thanks in advance for any thoughts and suggestions
The HKCU\Software\CodeGear\BDS\7.0\ registry section contains the "known packages" subtree that contains which components you have installed. reg export/import should save you some trouble.
You'll also want to backup/restore the actual files referenced there as well.
It has been a while since I used C++ Builder, but I will make two suggestions...
1) run regedit and looks for "builder". You will probably find a hive like hk_local_machine/software/codegear or such. Export that and you can import it later
2) have a look at GExperts - is they don't have the exact solution, they still have some pretty useful (and free) tools

Resources