Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an Excel template ,that needs to be validated the user data with our DB.
For that I made a class library and where I added all validate functions,with the connection string also hard coded in the class,then I made a reference the class library DLL to the VBA.

While running the macro the functionality all are working as expected in my system!.
Unfortunately when this template checking in another system it says

Can't find project or library


What I have tried:

I tried it for using the reference by programmatically but none of those helped me
excel - How to add a reference programmatically - Stack Overflow[^]
Posted
Updated 4-Dec-17 19:54pm
Comments
FranzBe 30-Oct-17 10:57am    
Sounds like your dll is dependent on something that is missing in the 'other system'. I would try to monitor the start of your macro with process monitor or with dependency walker
https://docs.microsoft.com/en-us/sysinternals/downloads/procmon
http://www.dependencywalker.com/
F-ES Sitecore 30-Oct-17 11:43am    
Have you registered the class library on the system? Just having the dll there isn't enough if it's a COM object.
RedDk 30-Oct-17 16:34pm    
I see your link to SO ... but have you tried "adding" the "reference" manually?
soumyaraj 31-Oct-17 5:19am    
I have referred the following link to develop the class library and the connection string could more secure.But when I copy the .xltm file in to another system and when running the macro, it shows the error 'can't find project or library'.
Let me know the class library dll also needed in the client machine and make reference again?

https://stackoverflow.com/questions/3217014/how-to-securely-store-connection-string-details-in-vba

1 solution

few tips here which I have tried when I had the same issue

1) Check that the new solution's projects run against a compatible framework to the project you're trying to include. I was trying to include a reference to a 4.0 project in a 3.5 project.

2) Try the normal cleaning of the projects and rebuilding, shutting down all Visual Studio instances and restart them

3) One possibility is that the target .NET Framework version of the class library is higher than that of the project.

4) Try to clear caches
tools->options->resharper->options-> general-> click the clear caches button and restart VS
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900